svn commit: r260140 - in stable/9/contrib/gcc: . config/rs6000 cp doc
Pedro F. Giffuni
pfg at FreeBSD.org
Tue Dec 31 20:18:13 UTC 2013
Author: pfg
Date: Tue Dec 31 20:18:10 2013
New Revision: 260140
URL: http://svnweb.freebsd.org/changeset/base/260140
Log:
MFC r259525, r259526, r259529
gcc: small merges from upstream
fix ICE in rs6000 when using -fno-trapping-math.
Solves GCC-PR target/30485
Solve GCC issues:
PR middle-end/32602
PR middle-end/32603
Updates the to documentation and processing improvement.
Obtained from: gcc 4.3 (rev. 120902, 120902, 119427, 126278, 126422;
GPLv2)
Modified:
stable/9/contrib/gcc/ChangeLog.gcc43
stable/9/contrib/gcc/calls.c
stable/9/contrib/gcc/config/rs6000/rs6000.c
stable/9/contrib/gcc/cp/decl.c
stable/9/contrib/gcc/cp/method.c
stable/9/contrib/gcc/cp/parser.c
stable/9/contrib/gcc/doc/cppopts.texi
stable/9/contrib/gcc/doc/invoke.texi
Directory Properties:
stable/9/ (props changed)
stable/9/contrib/gcc/ (props changed)
Modified: stable/9/contrib/gcc/ChangeLog.gcc43
==============================================================================
--- stable/9/contrib/gcc/ChangeLog.gcc43 Tue Dec 31 20:15:21 2013 (r260139)
+++ stable/9/contrib/gcc/ChangeLog.gcc43 Tue Dec 31 20:18:10 2013 (r260140)
@@ -45,6 +45,20 @@
* flags.h (force_align_functions_log): Delete.
* toplev.c (force_align_functions_log): Delete.
+2007-07-06 Josh Conner <jconner at apple.com> (r126422)
+
+ PR middle-end/32602
+ PR middle-end/32603
+ * calls.c (store_one_arg): Handle arguments which are partially
+ on the stack when detecting argument overlap.
+
+2007-07-03 Eric Christopher <echristo at apple.com> (r126278)
+
+ * doc/cppopts.texi: Add conflicting option note to -dM.
+ * doc/invoke.texi: Add note about possible conflicts with
+ -E for -dCHARS and note that -dM will not produce
+ any results if there is no machine dependent reorg.
+
2007-06-28 Geoffrey Keating <geoffk at apple.com> (r126088)
* doc/invoke.texi (C++ Dialect Options): Document
@@ -395,6 +409,12 @@
(override_options): Add PTA_CX16 flag. Set x86_cmpxchg16b
for CPUs that have PTA_CX16 set.
+2007-01-18 Josh Conner <jconner at apple.com> (r120902)
+
+ PR target/30485
+ * config/rs6000/rs6000.c (rs6000_emit_vector_compare): Add
+ support for UNLE, UNLT, UNGE, and UNGT.
+
2007-01-17 Eric Christopher <echristo at apple.com> (r120846)
* config.gcc: Support core2 processor.
Modified: stable/9/contrib/gcc/calls.c
==============================================================================
--- stable/9/contrib/gcc/calls.c Tue Dec 31 20:15:21 2013 (r260139)
+++ stable/9/contrib/gcc/calls.c Tue Dec 31 20:18:10 2013 (r260140)
@@ -4297,6 +4297,7 @@ store_one_arg (struct arg_data *arg, rtx
/* expand_call should ensure this. */
gcc_assert (!arg->locate.offset.var
+ && arg->locate.size.var == 0
&& GET_CODE (size_rtx) == CONST_INT);
if (arg->locate.offset.constant > i)
@@ -4306,7 +4307,21 @@ store_one_arg (struct arg_data *arg, rtx
}
else if (arg->locate.offset.constant < i)
{
- if (i < arg->locate.offset.constant + INTVAL (size_rtx))
+ /* Use arg->locate.size.constant instead of size_rtx
+ because we only care about the part of the argument
+ on the stack. */
+ if (i < (arg->locate.offset.constant
+ + arg->locate.size.constant))
+ sibcall_failure = 1;
+ }
+ else
+ {
+ /* Even though they appear to be at the same location,
+ if part of the outgoing argument is in registers,
+ they aren't really at the same location. Check for
+ this by making sure that the incoming size is the
+ same as the outgoing size. */
+ if (arg->locate.size.constant != INTVAL (size_rtx))
sibcall_failure = 1;
}
}
Modified: stable/9/contrib/gcc/config/rs6000/rs6000.c
==============================================================================
--- stable/9/contrib/gcc/config/rs6000/rs6000.c Tue Dec 31 20:15:21 2013 (r260139)
+++ stable/9/contrib/gcc/config/rs6000/rs6000.c Tue Dec 31 20:18:10 2013 (r260140)
@@ -11738,10 +11738,18 @@ rs6000_emit_vector_compare (enum rtx_cod
try_again = true;
break;
case NE:
- /* Treat A != B as ~(A==B). */
+ case UNLE:
+ case UNLT:
+ case UNGE:
+ case UNGT:
+ /* Invert condition and try again.
+ e.g., A != B becomes ~(A==B). */
{
+ enum rtx_code rev_code;
enum insn_code nor_code;
- rtx eq_rtx = rs6000_emit_vector_compare (EQ, op0, op1,
+
+ rev_code = reverse_condition_maybe_unordered (rcode);
+ rtx eq_rtx = rs6000_emit_vector_compare (rev_code, op0, op1,
dest_mode);
nor_code = one_cmpl_optab->handlers[(int)dest_mode].insn_code;
Modified: stable/9/contrib/gcc/cp/decl.c
==============================================================================
--- stable/9/contrib/gcc/cp/decl.c Tue Dec 31 20:15:21 2013 (r260139)
+++ stable/9/contrib/gcc/cp/decl.c Tue Dec 31 20:18:10 2013 (r260140)
@@ -758,7 +758,12 @@ poplevel (int keep, int reverse, int fun
leave_scope ();
if (functionbody)
- DECL_INITIAL (current_function_decl) = block;
+ {
+ /* The current function is being defined, so its DECL_INITIAL
+ should be error_mark_node. */
+ gcc_assert (DECL_INITIAL (current_function_decl) == error_mark_node);
+ DECL_INITIAL (current_function_decl) = block;
+ }
else if (block)
current_binding_level->blocks
= chainon (current_binding_level->blocks, block);
@@ -1635,13 +1640,15 @@ duplicate_decls (tree newdecl, tree oldd
}
/* If the new declaration is a definition, update the file and
- line information on the declaration. */
+ line information on the declaration, and also make
+ the old declaration the same definition. */
if (DECL_INITIAL (old_result) == NULL_TREE
&& DECL_INITIAL (new_result) != NULL_TREE)
{
DECL_SOURCE_LOCATION (olddecl)
= DECL_SOURCE_LOCATION (old_result)
= DECL_SOURCE_LOCATION (newdecl);
+ DECL_INITIAL (old_result) = DECL_INITIAL (new_result);
if (DECL_FUNCTION_TEMPLATE_P (newdecl))
DECL_ARGUMENTS (old_result)
= DECL_ARGUMENTS (new_result);
@@ -10509,7 +10516,13 @@ check_function_type (tree decl, tree cur
For C++, we must first check whether that datum makes any sense.
For example, "class A local_a(1,2);" means that variable local_a
is an aggregate of type A, which should have a constructor
- applied to it with the argument list [1, 2]. */
+ applied to it with the argument list [1, 2].
+
+ On entry, DECL_INITIAL (decl1) should be NULL_TREE or error_mark_node,
+ or may be a BLOCK if the function has been defined previously
+ in this translation unit. On exit, DECL_INITIAL (decl1) will be
+ error_mark_node if the function has never been defined, or
+ a BLOCK if the function has been defined somewhere. */
void
start_preparsed_function (tree decl1, tree attrs, int flags)
@@ -10638,24 +10651,6 @@ start_preparsed_function (tree decl1, tr
cp_apply_type_quals_to_decl (cp_type_quals (restype), resdecl);
}
- /* Initialize RTL machinery. We cannot do this until
- CURRENT_FUNCTION_DECL and DECL_RESULT are set up. We do this
- even when processing a template; this is how we get
- CFUN set up, and our per-function variables initialized.
- FIXME factor out the non-RTL stuff. */
- bl = current_binding_level;
- allocate_struct_function (decl1);
- current_binding_level = bl;
-
- /* Even though we're inside a function body, we still don't want to
- call expand_expr to calculate the size of a variable-sized array.
- We haven't necessarily assigned RTL to all variables yet, so it's
- not safe to try to expand expressions involving them. */
- cfun->x_dont_save_pending_sizes_p = 1;
-
- /* Start the statement-tree, start the tree now. */
- DECL_SAVED_TREE (decl1) = push_stmt_list ();
-
/* Let the user know we're compiling this function. */
announce_function (decl1);
@@ -10701,9 +10696,33 @@ start_preparsed_function (tree decl1, tr
maybe_apply_pragma_weak (decl1);
}
- /* Reset these in case the call to pushdecl changed them. */
+ /* Reset this in case the call to pushdecl changed it. */
current_function_decl = decl1;
- cfun->decl = decl1;
+
+ gcc_assert (DECL_INITIAL (decl1));
+
+ /* This function may already have been parsed, in which case just
+ return; our caller will skip over the body without parsing. */
+ if (DECL_INITIAL (decl1) != error_mark_node)
+ return;
+
+ /* Initialize RTL machinery. We cannot do this until
+ CURRENT_FUNCTION_DECL and DECL_RESULT are set up. We do this
+ even when processing a template; this is how we get
+ CFUN set up, and our per-function variables initialized.
+ FIXME factor out the non-RTL stuff. */
+ bl = current_binding_level;
+ allocate_struct_function (decl1);
+ current_binding_level = bl;
+
+ /* Even though we're inside a function body, we still don't want to
+ call expand_expr to calculate the size of a variable-sized array.
+ We haven't necessarily assigned RTL to all variables yet, so it's
+ not safe to try to expand expressions involving them. */
+ cfun->x_dont_save_pending_sizes_p = 1;
+
+ /* Start the statement-tree, start the tree now. */
+ DECL_SAVED_TREE (decl1) = push_stmt_list ();
/* If we are (erroneously) defining a function that we have already
defined before, wipe out what we knew before. */
@@ -11212,6 +11231,10 @@ finish_function (int flags)
which then got a warning when stored in a ptr-to-function variable. */
gcc_assert (building_stmt_tree ());
+ /* The current function is being defined, so its DECL_INITIAL should
+ be set, and unless there's a multiple definition, it should be
+ error_mark_node. */
+ gcc_assert (DECL_INITIAL (fndecl) == error_mark_node);
/* For a cloned function, we've already got all the code we need;
there's no need to add any extra bits. */
Modified: stable/9/contrib/gcc/cp/method.c
==============================================================================
--- stable/9/contrib/gcc/cp/method.c Tue Dec 31 20:15:21 2013 (r260139)
+++ stable/9/contrib/gcc/cp/method.c Tue Dec 31 20:18:10 2013 (r260140)
@@ -407,10 +407,6 @@ use_thunk (tree thunk_fndecl, bool emit_
}
}
- /* The back-end expects DECL_INITIAL to contain a BLOCK, so we
- create one. */
- DECL_INITIAL (thunk_fndecl) = make_node (BLOCK);
-
/* Set up cloned argument trees for the thunk. */
t = NULL_TREE;
for (a = DECL_ARGUMENTS (function); a; a = TREE_CHAIN (a))
@@ -424,17 +420,23 @@ use_thunk (tree thunk_fndecl, bool emit_
}
a = nreverse (t);
DECL_ARGUMENTS (thunk_fndecl) = a;
- BLOCK_VARS (DECL_INITIAL (thunk_fndecl)) = a;
if (this_adjusting
&& targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset,
virtual_value, alias))
{
const char *fnname;
+ tree fn_block;
+
current_function_decl = thunk_fndecl;
DECL_RESULT (thunk_fndecl)
= build_decl (RESULT_DECL, 0, integer_type_node);
fnname = XSTR (XEXP (DECL_RTL (thunk_fndecl), 0), 0);
+ /* The back-end expects DECL_INITIAL to contain a BLOCK, so we
+ create one. */
+ fn_block = make_node (BLOCK);
+ BLOCK_VARS (fn_block) = a;
+ DECL_INITIAL (thunk_fndecl) = fn_block;
init_function_start (thunk_fndecl);
current_function_is_thunk = 1;
assemble_start_function (thunk_fndecl, fnname);
Modified: stable/9/contrib/gcc/cp/parser.c
==============================================================================
--- stable/9/contrib/gcc/cp/parser.c Tue Dec 31 20:15:21 2013 (r260139)
+++ stable/9/contrib/gcc/cp/parser.c Tue Dec 31 20:18:10 2013 (r260140)
@@ -15637,6 +15637,16 @@ cp_parser_function_definition_from_speci
cp_parser_skip_to_end_of_block_or_statement (parser);
fn = error_mark_node;
}
+ else if (DECL_INITIAL (current_function_decl) != error_mark_node)
+ {
+ /* Seen already, skip it. An error message has already been output. */
+ cp_parser_skip_to_end_of_block_or_statement (parser);
+ fn = current_function_decl;
+ current_function_decl = NULL_TREE;
+ /* If this is a function from a class, pop the nested class. */
+ if (current_class_name)
+ pop_nested_class ();
+ }
else
fn = cp_parser_function_definition_after_declarator (parser,
/*inline_p=*/false);
Modified: stable/9/contrib/gcc/doc/cppopts.texi
==============================================================================
--- stable/9/contrib/gcc/doc/cppopts.texi Tue Dec 31 20:15:21 2013 (r260139)
+++ stable/9/contrib/gcc/doc/cppopts.texi Tue Dec 31 20:18:10 2013 (r260140)
@@ -645,6 +645,10 @@ touch foo.h; cpp -dM foo.h
@noindent
will show all the predefined macros.
+If you use @option{-dM} without the @option{-E} option, @option{-dM} is
+interpreted as a synonym for @option{-fdump-rtl-mach}.
+ at xref{Debugging Options, , ,gcc}.
+
@item D
@opindex dD
Like @samp{M} except in two respects: it does @emph{not} include the
Modified: stable/9/contrib/gcc/doc/invoke.texi
==============================================================================
--- stable/9/contrib/gcc/doc/invoke.texi Tue Dec 31 20:15:21 2013 (r260139)
+++ stable/9/contrib/gcc/doc/invoke.texi Tue Dec 31 20:18:10 2013 (r260140)
@@ -3683,7 +3683,9 @@ Says to make debugging dumps during comp
compiler. The file names for most of the dumps are made by appending a
pass number and a word to the @var{dumpname}. @var{dumpname} is generated
from the name of the output file, if explicitly specified and it is not
-an executable, otherwise it is the basename of the source file.
+an executable, otherwise it is the basename of the source file. These
+switches may have different effects when @option{-E} is used for
+preprocessing.
Most debug dumps can be enabled either passing a letter to the @option{-d}
option, or with a long @option{-fdump-rtl} switch; here are the possible
@@ -3818,7 +3820,7 @@ Dump after modulo scheduling, to @file{@
@opindex dM
@opindex fdump-rtl-mach
Dump after performing the machine dependent reorganization pass, to
- at file{@var{file}.155r.mach}.
+ at file{@var{file}.155r.mach} if that pass exists.
@item -dn
@itemx -fdump-rtl-rnreg
More information about the svn-src-stable-9
mailing list