aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2004-03-27 16:57:39 +0000
committerJakub Jelinek <jakub@redhat.com>2004-03-27 16:57:39 +0000
commit57ca0a1c11cec77270c2e2b18391756f69c437fc (patch)
treedab60f49ae6e08b5ef4d1754ebe5d2972be1c975
parent1d1eaa3e297c92d7cd4b1eae228a411a578e729c (diff)
cvs update -Pd -jgcc-3_3-branch:2004{0312,0327}
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-3_3-rhl-branch@80030 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog299
-rw-r--r--gcc/c-tree.h2
-rw-r--r--gcc/c-typeck.c59
-rw-r--r--gcc/config.gcc22
-rw-r--r--gcc/config/arm/arm.c6
-rw-r--r--gcc/config/arm/arm.h15
-rw-r--r--gcc/config/i386/i386.c18
-rw-r--r--gcc/config/rtems.h18
-rw-r--r--gcc/config/s390/s390.c5
-rw-r--r--gcc/config/sparc/t-linux644
-rw-r--r--gcc/cp/ChangeLog47
-rw-r--r--gcc/cp/call.c10
-rw-r--r--gcc/cp/class.c45
-rw-r--r--gcc/cp/decl.c38
-rw-r--r--gcc/cp/decl2.c6
-rw-r--r--gcc/cp/init.c8
-rw-r--r--gcc/cp/typeck2.c111
-rw-r--r--gcc/cpplib.c3
-rw-r--r--gcc/cse.c17
-rw-r--r--gcc/dbxout.c5
-rw-r--r--gcc/doc/extend.texi4
-rw-r--r--gcc/doc/invoke.texi7
-rw-r--r--gcc/dwarf2out.c260
-rw-r--r--gcc/except.c14
-rw-r--r--gcc/expr.c46
-rw-r--r--gcc/f/ChangeLog17
-rw-r--r--gcc/f/g77.texi25
-rw-r--r--gcc/f/invoke.texi8
-rw-r--r--gcc/f/root.texi2
-rw-r--r--gcc/fixinc/fixincl.x47
-rw-r--r--gcc/fixinc/inclhack.def25
-rw-r--r--gcc/fold-const.c212
-rw-r--r--gcc/gcc.c14
-rw-r--r--gcc/reload1.c2
-rw-r--r--gcc/testsuite/ChangeLog25
-rw-r--r--gcc/testsuite/g++.dg/lookup/enum2.C5
-rw-r--r--gcc/testsuite/gcc.dg/const-1.c56
-rw-r--r--gcc/tree-inline.c8
-rw-r--r--gcc/unroll.c5
-rw-r--r--gcc/version.c2
-rw-r--r--libstdc++-v3/include/bits/c++config2
41 files changed, 1119 insertions, 405 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 121c8f13708..4407a63b4e6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,194 @@
+2004-03-26 Richard Henderson <rth@redhat.com>
+
+ PR 11527
+ * c-typeck.c (pop_init_level): Emit pending init elements earlier
+ rather than later.
+
+2004-03-26 Jan Hubicka <jh@suse.cz>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ PR Target/14723
+ * config.gcc: Add support --with-cpu=nocona.
+
+ * config/i386/i386.c (override_options): Add support for
+ Prescott and Nocona.
+
+ * doc/invoke.texi: Extend documentation of -mcpu/-march for new
+ CPUs.
+
+2004-03-25 Jakub Jelinek <jakub@redhat.com>
+
+ * config.gcc (sparc-*-linux*): Add sparc/t-linux to tmake_file.
+ * config/sparc/t-linux64 (TARGET_LIBGCC2_CFLAGS): Set.
+ * config/sparc/t-linux: New file.
+
+2004-03-24 Kelley Cook <kcook@gcc.gnu.org>
+
+ Backport:
+ 2004-03-01 Mark Mitchell <mark@codesourcery.com>
+
+ PR bootstrap/14356
+ * gcc.c (process_command): Remove const-qualification from argv.
+ (main): Likewise.
+
+2004-03-24 Alexandre Oliva <aoliva@redhat.com>
+
+ PR preprocessor/14438
+ * cpplib.c (do_pragma): Remove line_change call after pragma
+ handler.
+
+2004-03-22 Andrew Pinski <pinskia@physics.uc.edu>
+
+ BackPort:
+ 2004-01-09 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR debug/11231
+ * dbxout.c (dbxout_type_fields): Return if any item is error_mark_node or the
+ type is error_mark_node.
+
+2004-03-22 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR middle-end/14470
+ * expr.c (mark_queue): New function.
+ (emit_insns_enqueued_after_mark): New function replacing
+ emit_queue. Clear the body of emitted queued insns.
+ (emit_queue): Call emit_insns_enqueued_after_mark.
+ (store_expr): Mark the increment queue on entry. Emit
+ only the incrementations queued when expanding the source.
+
+2004-03-17 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+ PR target/14260
+ * config/rtems.h: Add STD_LIB_SPEC and LIB_SPEC.
+
+2004-03-21 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (fold) <EQ_EXPR>: Rewrite optimization to transform
+ "foo++ == const" into "++foo == const+incr".
+
+2004-03-21 Roger Sayle <roger@eyesopen.com>
+
+ PR target/13889
+ * cse.c (fold_rtx): Avoid substituting constants into unary
+ conversion operations.
+
+2004-03-17 Ian Lance Taylor <ian@wasabisystems.com>
+
+ Backport:
+ 2003-11-08 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * c-typeck.c (pedantic_lvalue_warning): Deprecate compound
+ expressions as lvalues.
+ * doc/extend.texi: Document that all extended lvalues are now
+ deprecated.
+
+ 2003-11-05 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * c-typeck.c (pedantic_lvalue_warning): Deprecate use of
+ conditional expressions as lvalues.
+
+ 2003-10-22 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * c-typeck.c (pedantic_lvalue_warning): Unconditionally warn of
+ deprecation of casts as lvalues.
+ * fixinc/inclhack.def (obstack_lvalue_cast): New fix.
+ * fixinc/fixincl.x: Regenerate.
+
+2004-03-15 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/14535
+ * except.c (collect_one_action_chain): Record action for cleanup
+ outer of exception spec.
+
+2004-03-13 Dara Hazeghi <dhazeghi@yahoo.com>
+
+ * doc/install.texi: Note status of -fnew-ra.
+
+2004-03-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/14533
+ * config/s390/s390.c (legitimize_pic_address): Don't abort on UNSPEC
+ other than 100.
+
+2004-03-13 Alan Modra <amodra@bigpond.net.au>
+
+ PR debug/11983
+ * dwarf2out.c (enum dw_val_class): Rename dw_val_class_float to
+ dw_val_class_vec. Replace use throughout file.
+ (dw_float_const): Delete.
+ (dw_vec_const): New.
+ (dw_val_struct_union): Rename val_float to val_vec. Replace use
+ throughout file.
+ (add_AT_vec): Rename from add_AT_float. Add elt_size param.
+ (same_dw_val_p): Adjust vec comparison. Use memcmp.
+ (size_of_die): Adjust dw_val_class_vec sizing.
+ (output_die): Output dw_val_class_vec.
+ (insert_int, extract_int, insert_float): New functions.
+ (add_const_value_attribute): Use insert_float for CONST_DOUBLE.
+ Handle CONST_VECTOR.
+ (add_location_or_const_value_attribute): Handle CONST_VECTOR.
+
+2004-03-12 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ Backport:
+ 2004-03-13 Eric Botcazou <ebotcazou@libertysurf.fr>
+ PR middle-end/14470
+ * expr.c (store_expr): Call emit_queue before generating the move
+ from the temporary to the original target. Protect the temporary
+ from emit_queue.
+
+2004-03-10 James E Wilson <wilson@specifixinc.com>
+
+ PR target/13877
+ * unroll.c (unroll_loop): If precondition loop, clear the initial_value
+ field in loop_info.
+
+2004-03-12 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ Backport:
+ 2004-03-05 Nathan Sidwell <nathan@codesourcery.com>
+ PR driver/13577
+ * gcc.c (cc1_options): Robustify -auxbase-strip from multiple -o
+ options.
+
+2004-03-12 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ Endorse:
+ 2004-01-10 Eric Botcazou <ebotcazou@libertysurf.fr>
+ PR optimization/13472
+ * reload.c (reload): Don't record unchanging memory locations.
+
+2004-03-12 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ Backport
+ 2004-02-27 Mark Mitchell <mark@codesourcery.com>
+ PR middle-end/13448
+ * c-tree.h (readonly_warning): Rename to ...
+ (readonly_error): ... this.
+ * c-typeck.c (build_unary_op): Adjust accordingly.
+ (readonly_warning): Rename to ...
+ (readonly_error): ... this and issue errors, not warnings.
+ (build_modify_expr): Call readonly_error, not readonly_warning.
+ (c_expand_asm_operands): Likewise.
+ * tree-inline.c (optimize_inline_calls): Do not inline
+ functions after errors have occurred.
+
+2004-03-12 Philip Blundell <philb@gnu.org>
+
+ PR target/10730
+ Backport from trunk:
+ 2003-05-15 Philip Blundell <philb@gnu.org>
+ * config/arm/arm.c (adjacent_mem_locations): Reject offsets
+ involving invalid constants.
+
+2004-03-12 Philip Blundell <philb@gnu.org>
+
+ PR target/14558
+ Backport from trunk:
+ 2004-02-25 Richard Earnshaw <rearnsha@arm.com>
+ * arm.h (ARM_GO_IF_LEGITIMATE_INDEX): For QImode the range of
+ an offset is -4095...+4095 inclusive.
+
2004-03-12 Jakub Jelinek <jakub@redhat.com>
* config/rs6000/rs6000-protos.h (rs6000_output_dwarf_dtprel): Add
@@ -127,25 +318,25 @@
2004-03-07 Aldy Hernandez <aldyh@redhat.com>
- * config/rs6000/rs6000.md (ashrdi3): Do not call ashrdi3_no_power
- for little endian.
- ("ashrdi3_no_power"): Disable for little endian.
+ * config/rs6000/rs6000.md (ashrdi3): Do not call ashrdi3_no_power
+ for little endian.
+ ("ashrdi3_no_power"): Disable for little endian.
(ashrdi3): Same.
2004-03-07 Richard Henderson <rth@redhat.com>
- * config/alpha/alpha.h (MASK_LONG_DOUBLE_128): New.
- (TARGET_LONG_DOUBLE_128): New.
- (TARGET_SWITCHES): Add long-double-{128,64}.
- (TARGET_HAS_XFLOATING_LIBS): Default to TARGET_LONG_DOUBLE_128.
- (LONG_DOUBLE_TYPE_SIZE): Honor TARGET_LONG_DOUBLE_128.
- (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): New.
- (WIDEST_HARDWARE_FP_SIZE): New.
- (TARGET_CPU_CPP_BUILTINS): Define __LONG_DOUBLE_128__.
- * config/alpha/alpha.c (override_options): Clear MASK_LONG_DOUBLE_128
- if TARGET_VAX_FLOAT.
- * config/alpha/osf5.h (LONG_DOUBLE_TYPE_SIZE): Remove.
- (TARGET_DEFAULT): Set MASK_LONG_DOUBLE_128.
+ * config/alpha/alpha.h (MASK_LONG_DOUBLE_128): New.
+ (TARGET_LONG_DOUBLE_128): New.
+ (TARGET_SWITCHES): Add long-double-{128,64}.
+ (TARGET_HAS_XFLOATING_LIBS): Default to TARGET_LONG_DOUBLE_128.
+ (LONG_DOUBLE_TYPE_SIZE): Honor TARGET_LONG_DOUBLE_128.
+ (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): New.
+ (WIDEST_HARDWARE_FP_SIZE): New.
+ (TARGET_CPU_CPP_BUILTINS): Define __LONG_DOUBLE_128__.
+ * config/alpha/alpha.c (override_options): Clear MASK_LONG_DOUBLE_128
+ if TARGET_VAX_FLOAT.
+ * config/alpha/osf5.h (LONG_DOUBLE_TYPE_SIZE): Remove.
+ (TARGET_DEFAULT): Set MASK_LONG_DOUBLE_128.
2004-03-08 Hans-Peter Nilsson <hp@axis.com>
@@ -172,7 +363,7 @@
2004-03-06 Richard Henderson <rth@redhat.com>
- * config/alpha/alpha.c (alpha_in_small_data_p): False for functions.
+ * config/alpha/alpha.c (alpha_in_small_data_p): False for functions.
2004-03-05 Ulrich Weigand <uweigand@de.ibm.com>
@@ -258,15 +449,15 @@
2004-03-02 Richard Henderson <rth@redhat.com>
- PR middle-end/11767
- * optabs.c (prepare_cmp_insn): Force trapping memories to registers
- before the compare, if flag_non_call_exceptions.
+ PR middle-end/11767
+ * optabs.c (prepare_cmp_insn): Force trapping memories to registers
+ before the compare, if flag_non_call_exceptions.
2004-03-02 Richard Henderson <rth@redhat.com>
- PR middle-end/14327
- * stmt.c (expand_computed_goto): Do do_pending_stack_adjust before
- emitting the label, not after.
+ PR middle-end/14327
+ * stmt.c (expand_computed_goto): Do do_pending_stack_adjust before
+ emitting the label, not after.
2004-03-02 Danny Smith <dannysmith@users.sourceforge.net>
@@ -282,9 +473,9 @@
constants as signed values.
2004-01-16 J"orn Rennecke <joern.rennecke@superh.com>
- PR optimization/11864
- * reload1.c (reload_cse_simplify_operands): Don't remove
- implicit extension from LOAD_EXTEND_OP.
+ PR optimization/11864
+ * reload1.c (reload_cse_simplify_operands): Don't remove
+ implicit extension from LOAD_EXTEND_OP.
2004-02-29 Hans-Peter Nilsson <hp@axis.com>
@@ -494,7 +685,7 @@
* config/i386/i386.c: Rename pni to sse3.
* config/i386/i386.h: Likewise.
- * config/i386/i386.md: Likewise.
+ * config/i386/i386.md: Likewise.
* config/i386/pmmintrin.h: Likewise.
* doc/extend.texi: Likewise.
* doc/invoke.texi: Likewise.
@@ -544,10 +735,10 @@
2004-01-23 Richard Henderson <rth@redhat.com>
- PR opt/12941
- * combine.c (SHIFT_COUNT_TRUNCATED): Provide default value.
- (simplify_comparison): Don't simplify (eq (zero_extract c 1 r) 0)
- if SHIFT_COUNT_TRUNCATED is set.
+ PR opt/12941
+ * combine.c (SHIFT_COUNT_TRUNCATED): Provide default value.
+ (simplify_comparison): Don't simplify (eq (zero_extract c 1 r) 0)
+ if SHIFT_COUNT_TRUNCATED is set.
2004-01-23 Ian Lance Taylor <ian@wasabisystems.com>
@@ -567,18 +758,18 @@
2004-01-21 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
PR target/13073
- * config/h8300/t-rtems (h8300-*-rtems*): New.
- * config.gcc: Use config/h8300/t-rtems.
+ * config/h8300/t-rtems (h8300-*-rtems*): New.
+ * config.gcc: Use config/h8300/t-rtems.
2004-01-20 Gabriel Dos Reis <gdr@integrable-solutions.net>
- Backport from mainline
+ Backport from mainline
- 2004-01-10 Jan Hubicka <jh@suse.cz>
- PR opt/12826
- * loop.c (insert_loop_mem): Prefer VOLATILE memory references to be
- stored.
-
+ 2004-01-10 Jan Hubicka <jh@suse.cz>
+ PR opt/12826
+ * loop.c (insert_loop_mem): Prefer VOLATILE memory references to be
+ stored.
+
2004-01-16 Jan Hubicka <jh@suse.cz>
PR opt/13608
@@ -586,16 +777,16 @@
2004-01-16 Segher Boessenkool <boessen@de.ibm.com>
- PR target/11793
+ PR target/11793
* config/rs6000/rs6000.h (LEGITIMATE_CONSTANT_P): Handle
vectors.
2004-01-16 Jan Hubicka <jh@suse.cz>
- PR opt/11350
- * cfgcleanup.c (try_optimize_cfg): Suppress tablejump removal
+ PR opt/11350
+ * cfgcleanup.c (try_optimize_cfg): Suppress tablejump removal
after reload.
- * cfgrtl.c (try_redirect_by_replacing_branch): Likewise.
+ * cfgrtl.c (try_redirect_by_replacing_branch): Likewise.
2004-01-15 J"orn Rennecke <joern.rennecke@superh.com>
@@ -621,11 +812,11 @@
2003-01-14 Nicola Pero <n.pero@mi.flashnet.it>
PR objc/7993
- * objc-act.c (is_private): Do not emit the 'instance variable %s
- is declared private' error.
- (is_public): Emit the error after calling is_private.
- (lookup_objc_ivar): If the instance variable is private, return 0
- - the instance variable is invisible here.
+ * objc-act.c (is_private): Do not emit the 'instance variable %s
+ is declared private' error.
+ (is_public): Emit the error after calling is_private.
+ (lookup_objc_ivar): If the instance variable is private, return 0
+ - the instance variable is invisible here.
2004-01-12 Marc Espie <espie@openbsd.org>
@@ -633,10 +824,10 @@
2004-01-12 Matthias Klose <doko@debian.org>
- Backport from mainline
+ Backport from mainline
- 2003-12-08 Stuart Hastings <stuart@apple.com>
- * config/i386/i386.md: Typo in split of fp-valued if_then_else.
+ 2003-12-08 Stuart Hastings <stuart@apple.com>
+ * config/i386/i386.md: Typo in split of fp-valued if_then_else.
2004-01-12 Roger Sayle <roger@eyesopen.com>
@@ -691,10 +882,10 @@
Backport the following from mainline:
2003-03-08 Neil Booth <neil@daikokuya.co.uk>
- * config/sh/rtemself.h (TARGET_OS_CPP_BUILTINS): Use instead of
- CPP_PREDEFINES.
- * config/sh/rtems.h (TARGET_OS_CPP_BUILTINS): Use instead of
- CPP_PREDEFINES.
+ * config/sh/rtemself.h (TARGET_OS_CPP_BUILTINS): Use instead of
+ CPP_PREDEFINES.
+ * config/sh/rtems.h (TARGET_OS_CPP_BUILTINS): Use instead of
+ CPP_PREDEFINES.
2003-09-27 Kelley Cook <kcook@gcc.gnu.org>
* config/sh/rtemself.h, config/sh/rtems.h: GNU CC -> GCC.
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index df6bf2de0a0..0a3e334b041 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -270,7 +270,7 @@ extern tree build_external_ref PARAMS ((tree, int));
extern tree parser_build_binary_op PARAMS ((enum tree_code,
tree, tree));
extern int c_tree_expr_nonnegative_p PARAMS ((tree));
-extern void readonly_warning PARAMS ((tree, const char *));
+extern void readonly_error PARAMS ((tree, const char *));
extern tree build_conditional_expr PARAMS ((tree, tree, tree));
extern tree build_compound_expr PARAMS ((tree));
extern tree c_cast_expr PARAMS ((tree, tree));
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 25731f716eb..b7807fb2d67 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -2968,10 +2968,10 @@ build_unary_op (code, xarg, flag)
/* Report a read-only lvalue. */
if (TREE_READONLY (arg))
- readonly_warning (arg,
- ((code == PREINCREMENT_EXPR
- || code == POSTINCREMENT_EXPR)
- ? "increment" : "decrement"));
+ readonly_error (arg,
+ ((code == PREINCREMENT_EXPR
+ || code == POSTINCREMENT_EXPR)
+ ? "increment" : "decrement"));
if (TREE_CODE (TREE_TYPE (arg)) == BOOLEAN_TYPE)
val = boolean_increment (code, arg);
@@ -3234,41 +3234,40 @@ static void
pedantic_lvalue_warning (code)
enum tree_code code;
{
- if (pedantic)
- switch (code)
- {
- case COND_EXPR:
- pedwarn ("ISO C forbids use of conditional expressions as lvalues");
- break;
- case COMPOUND_EXPR:
- pedwarn ("ISO C forbids use of compound expressions as lvalues");
- break;
- default:
- pedwarn ("ISO C forbids use of cast expressions as lvalues");
- break;
- }
+ switch (code)
+ {
+ case COND_EXPR:
+ pedwarn ("use of conditional expressions as lvalues is deprecated");
+ break;
+ case COMPOUND_EXPR:
+ pedwarn ("use of compound expressions as lvalues is deprecated");
+ break;
+ default:
+ pedwarn ("use of cast expressions as lvalues is deprecated");
+ break;
+ }
}
/* Warn about storing in something that is `const'. */
void
-readonly_warning (arg, msgid)
+readonly_error (arg, msgid)
tree arg;
const char *msgid;
{
if (TREE_CODE (arg) == COMPONENT_REF)
{
if (TYPE_READONLY (TREE_TYPE (TREE_OPERAND (arg, 0))))
- readonly_warning (TREE_OPERAND (arg, 0), msgid);
+ readonly_error (TREE_OPERAND (arg, 0), msgid);
else
- pedwarn ("%s of read-only member `%s'", _(msgid),
- IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (arg, 1))));
+ error ("%s of read-only member `%s'", _(msgid),
+ IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (arg, 1))));
}
else if (TREE_CODE (arg) == VAR_DECL)
- pedwarn ("%s of read-only variable `%s'", _(msgid),
- IDENTIFIER_POINTER (DECL_NAME (arg)));
+ error ("%s of read-only variable `%s'", _(msgid),
+ IDENTIFIER_POINTER (DECL_NAME (arg)));
else
- pedwarn ("%s of read-only location", _(msgid));
+ error ("%s of read-only location", _(msgid));
}
/* Mark EXP saying that we need to be able to take the
@@ -3955,7 +3954,7 @@ build_modify_expr (lhs, modifycode, rhs)
|| ((TREE_CODE (lhstype) == RECORD_TYPE
|| TREE_CODE (lhstype) == UNION_TYPE)
&& C_TYPE_FIELDS_READONLY (lhstype)))
- readonly_warning (lhs, "assignment");
+ readonly_error (lhs, "assignment");
/* If storing into a structure or union member,
it has probably been given type `int'.
@@ -5500,6 +5499,10 @@ pop_init_level (implicit)
abort ();
}
+ /* Now output all pending elements. */
+ constructor_incremental = 1;
+ output_pending_init_elements (1);
+
p = constructor_stack;
/* Error for initializing a flexible array member, or a zero-length
@@ -5554,10 +5557,6 @@ pop_init_level (implicit)
}
}
- /* Now output all pending elements. */
- constructor_incremental = 1;
- output_pending_init_elements (1);
-
/* Pad out the end of the structure. */
if (p->replacement_value)
/* If this closes a superfluous brace pair,
@@ -7037,7 +7036,7 @@ c_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
|| ((TREE_CODE (type) == RECORD_TYPE
|| TREE_CODE (type) == UNION_TYPE)
&& C_TYPE_FIELDS_READONLY (type)))
- readonly_warning (o[i], "modification by `asm'");
+ readonly_error (o[i], "modification by `asm'");
}
}
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 52258273d9f..43c63c09594 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2444,7 +2444,7 @@ sparc-*-linux*libc1*) # SPARC's running GNU/Linux, libc5
;;
sparc-*-linux*) # SPARC's running GNU/Linux, libc6
tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/linux.h"
- tmake_file="t-slibgcc-elf-ver t-linux sparc/t-crtfm"
+ tmake_file="t-slibgcc-elf-ver t-linux sparc/t-linux sparc/t-crtfm"
;;
sparc-*-lynxos*)
if test x$gas = xyes
@@ -2832,7 +2832,25 @@ x86_64-*-*)
# We should have hammer chip here, but it does not exist yet and
# thus it is not supported. Athlon_SSE is probably equivalent feature
# wise to hammer from our point of view except for 64bit mode.
- target_cpu_default2=TARGET_CPU_DEFAULT_athlon_sse
+ case "x$with_cpu" in
+ x)
+ target_cpu_default2=TARGET_CPU_DEFAULT_athlon_sse
+ ;;
+ xnocona)
+ target_cpu_default2=TARGET_CPU_DEFAULT_pentium4
+ ;;
+ xyes|xno)
+ echo "--with-cpu must be passed a value" 1>&2
+ exit 1
+ ;;
+ *)
+ if test x$pass2done = xyes
+ then
+ echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
+ exit 1
+ fi
+ ;;
+ esac
;;
alpha*-*-*)
case $machine in
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 7422f1d03af..1efadc61db0 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -3778,6 +3778,12 @@ adjacent_mem_locations (a, b)
else
reg1 = REGNO (XEXP (b, 0));
+ /* Don't accept any offset that will require multiple instructions to handle,
+ since this would cause the arith_adjacentmem pattern to output an overlong
+ sequence. */
+ if (!const_ok_for_op (PLUS, val0) || !const_ok_for_op (PLUS, val1))
+ return 0;
+
return (reg0 == reg1) && ((val1 - val0) == 4 || (val0 - val1) == 4);
}
return 0;
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 5b03c6ffec2..cb49f572efb 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -2003,10 +2003,17 @@ typedef struct
&& INTVAL (op) <= 31) \
goto LABEL; \
} \
- /* NASTY: Since this limits the addressing of unsigned \
- byte loads. */ \
- range = ((MODE) == HImode || (MODE) == QImode) \
- ? (arm_arch4 ? 256 : 4095) : 4096; \
+ /* XXX For ARM v4 we may be doing a sign-extend operation \
+ during the load, but that has a restricted addressing \
+ range and we are unable to tell here whether that is the \
+ case. To be safe we restrict all loads to that \
+ range. */ \
+ if (arm_arch4) \
+ range = (mode == HImode || mode == QImode) ? 256 : 4096; \
+ else if (mode == HImode) \
+ range = 4095; \
+ else \
+ range = 4096; \
if (code == CONST_INT && INTVAL (INDEX) < range \
&& INTVAL (INDEX) > -range) \
goto LABEL; \
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 43de8e8140c..cb26a42f07f 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -977,9 +977,10 @@ override_options ()
{
PTA_SSE = 1,
PTA_SSE2 = 2,
- PTA_MMX = 4,
- PTA_PREFETCH_SSE = 8,
- PTA_3DNOW = 16,
+ PTA_SSE3 = 4,
+ PTA_MMX = 8,
+ PTA_PREFETCH_SSE = 16,
+ PTA_3DNOW = 32,
PTA_3DNOW_A = 64
} flags;
}
@@ -997,8 +998,12 @@ override_options ()
{"pentiumpro", PROCESSOR_PENTIUMPRO, 0},
{"pentium2", PROCESSOR_PENTIUMPRO, PTA_MMX},
{"pentium3", PROCESSOR_PENTIUMPRO, PTA_MMX | PTA_SSE | PTA_PREFETCH_SSE},
- {"pentium4", PROCESSOR_PENTIUM4, PTA_SSE | PTA_SSE2 |
- PTA_MMX | PTA_PREFETCH_SSE},
+ {"pentium4", PROCESSOR_PENTIUM4, PTA_SSE | PTA_SSE2
+ | PTA_MMX | PTA_PREFETCH_SSE},
+ {"prescott", PROCESSOR_PENTIUM4, PTA_SSE | PTA_SSE2 | PTA_SSE3
+ | PTA_MMX | PTA_PREFETCH_SSE},
+ {"nocona", PROCESSOR_PENTIUM4, PTA_SSE | PTA_SSE2 | PTA_SSE3
+ | PTA_MMX | PTA_PREFETCH_SSE},
{"k6", PROCESSOR_K6, PTA_MMX},
{"k6-2", PROCESSOR_K6, PTA_MMX | PTA_3DNOW},
{"k6-3", PROCESSOR_K6, PTA_MMX | PTA_3DNOW},
@@ -1116,6 +1121,9 @@ override_options ()
if (processor_alias_table[i].flags & PTA_SSE2
&& !(target_flags_explicit & MASK_SSE2))
target_flags |= MASK_SSE2;
+ if (processor_alias_table[i].flags & PTA_SSE3
+ && !(target_flags_explicit & MASK_SSE3))
+ target_flags |= MASK_SSE3;
if (processor_alias_table[i].flags & PTA_PREFETCH_SSE)
x86_prefetch_sse = true;
break;
diff --git a/gcc/config/rtems.h b/gcc/config/rtems.h
index a3f9ba301b4..a40e474ee8d 100644
--- a/gcc/config/rtems.h
+++ b/gcc/config/rtems.h
@@ -1,7 +1,7 @@
/* Configuration common to all targets running RTEMS.
- Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -35,3 +35,17 @@ Boston, MA 02111-1307, USA. */
#undef ENDFILE_SPEC
#define ENDFILE_SPEC ""
+
+/*
+ * Some targets do not set up LIB_SPECS, override it, here.
+ */
+#define STD_LIB_SPEC \
+ "%{!shared:%{g*:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}"
+
+#undef LIB_SPEC
+#define LIB_SPEC "%{!qrtems: " STD_LIB_SPEC "} " \
+"%{!nostdlib: %{qrtems: --start-group \
+ %{!qrtems_debug: -lrtemsbsp -lrtemscpu} \
+ %{qrtems_debug: -lrtemsbsp_g -lrtemscpu_g} \
+ -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}}"
+
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 4dd7c62cd79..d0f26756532 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -2268,12 +2268,11 @@ legitimize_pic_address (orig, reg)
that was pulled out of the literal pool. Force it back in. */
else if (GET_CODE (op0) == UNSPEC
- && GET_CODE (op1) == CONST_INT)
+ && GET_CODE (op1) == CONST_INT
+ && XINT (op0, 1) == 100)
{
if (XVECLEN (op0, 0) != 1)
abort ();
- if (XINT (op0, 1) != 100)
- abort ();
new = force_const_mem (Pmode, orig);
}
diff --git a/gcc/config/sparc/t-linux64 b/gcc/config/sparc/t-linux64
index 3e3fa4cae7e..d21e149e428 100644
--- a/gcc/config/sparc/t-linux64
+++ b/gcc/config/sparc/t-linux64
@@ -17,3 +17,7 @@ SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \
CRTSTUFF_T_CFLAGS = `if test x$$($(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) \
-print-multi-os-directory) \
= x../lib64; then echo -mcmodel=medany; fi`
+
+# Compile libgcc2.a with pic and for -m32 also IEEE quad long double.
+# -m64 implies -mlong-double-128, so this is no change for 64-bit.
+TARGET_LIBGCC2_CFLAGS = -fPIC -mlong-double-128
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 81045afb287..af1127f1c8c 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,50 @@
+2003-03-17 Matt Austern <austern@apple.com>
+
+ Backport:
+ PR debug/14079
+ * decl.c (add_decl_to_level): Add extern variables, as well
+ as static, to static_decls array.
+
+2004-03-12 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ Backport:
+ 2004-03-11 Mark Mitchell <mark@codesourcery.com>
+ PR c++/14476
+ * decl.c (xref_tag): Do not create dummy ENUMERAL_TYPEs.
+
+2004-03-12 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ Backport:
+ 2004-03-08 Mark Mitchell <mark@codesourcery.com>
+ PR c++/14401
+ * class.c (check_field_decls): Complain about non-static data
+ members of reference type in unions. Propagate
+ CLASSTYPE_REF_FIELDS_NEED_INIT and
+ CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of non-static
+ data members.
+ * init.c (perform_member_init): Complain about members with const
+ type that are not explicitly initialized.
+
+2004-03-12 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ Backport:
+ 2004-03-09 Mark Mitchell <mark@codesourcery.com>
+ PR c++/14230
+ * call.c (initialize_reference): Handle initializers that are
+ class-member access expressions applies to rvalues.
+
+2004-03-12 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ Backport:
+ 2004-01-12 Richard Henderson <rth@redhat.com>
+ PR opt/10776
+ * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): New.
+ (store_init_value): Use it.
+ * decl.c (check_initializer): Expect full initialization code
+ from store_init_value.
+ * init.c (expand_aggr_init_1): Likewise.
+ * decl2.c (maybe_emit_vtables): Abort if runtime init needed.
+
2004-03-09 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/14409
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index a8e4457f15a..e45d5aaee0c 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -6204,6 +6204,16 @@ initialize_reference (type, expr, decl, cleanup)
type = TREE_TYPE (expr);
var = make_temporary_var_for_ref_to_temp (decl, type);
layout_decl (var, 0);
+ /* If the rvalue is the result of a function call it will be
+ a TARGET_EXPR. If it is some other construct (such as a
+ member access expression where the underlying object is
+ itself the result of a function call), turn it into a
+ TARGET_EXPR here. It is important that EXPR be a
+ TARGET_EXPR below since otherwise the INIT_EXPR will
+ attempt to make a bitwise copy of EXPR to intialize
+ VAR. */
+ if (TREE_CODE (expr) != TARGET_EXPR)
+ expr = get_target_expr (expr);
/* Create the INIT_EXPR that will initialize the temporary
variable. */
init = build (INIT_EXPR, type, var, expr);
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 3546743f215..0c5ace708f2 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -3231,9 +3231,30 @@ check_field_decls (tree t, tree *access_decls,
/* If we've gotten this far, it's a data member, possibly static,
or an enumerator. */
-
DECL_CONTEXT (x) = t;
+ /* When this goes into scope, it will be a non-local reference. */
+ DECL_NONLOCAL (x) = 1;
+
+ if (TREE_CODE (t) == UNION_TYPE)
+ {
+ /* [class.union]
+
+ If a union contains a static data member, or a member of
+ reference type, the program is ill-formed. */
+ if (TREE_CODE (x) == VAR_DECL)
+ {
+ cp_error_at ("`%D' may not be static because it is a member of a union", x);
+ continue;
+ }
+ if (TREE_CODE (type) == REFERENCE_TYPE)
+ {
+ cp_error_at ("`%D' may not have reference type `%T' because it is a member of a union",
+ x, type);
+ continue;
+ }
+ }
+
/* ``A local class cannot have static data members.'' ARM 9.4 */
if (current_function_decl && TREE_STATIC (x))
cp_error_at ("field `%D' in local class cannot be static", x);
@@ -3263,21 +3284,9 @@ check_field_decls (tree t, tree *access_decls,
if (type == error_mark_node)
continue;
- /* When this goes into scope, it will be a non-local reference. */
- DECL_NONLOCAL (x) = 1;
-
- if (TREE_CODE (x) == CONST_DECL)
+ if (TREE_CODE (x) == CONST_DECL || TREE_CODE (x) == VAR_DECL)
continue;
- if (TREE_CODE (x) == VAR_DECL)
- {
- if (TREE_CODE (t) == UNION_TYPE)
- /* Unions cannot have static members. */
- cp_error_at ("field `%D' declared static in union", x);
-
- continue;
- }
-
/* Now it can only be a FIELD_DECL. */
if (TREE_PRIVATE (x) || TREE_PROTECTED (x))
@@ -3308,6 +3317,14 @@ check_field_decls (tree t, tree *access_decls,
if (TREE_CODE (type) == POINTER_TYPE)
has_pointers = 1;
+ if (CLASS_TYPE_P (type))
+ {
+ if (CLASSTYPE_REF_FIELDS_NEED_INIT (type))
+ SET_CLASSTYPE_REF_FIELDS_NEED_INIT (t, 1);
+ if (CLASSTYPE_READONLY_FIELDS_NEED_INIT (type))
+ SET_CLASSTYPE_READONLY_FIELDS_NEED_INIT (t, 1);
+ }
+
if (DECL_MUTABLE_P (x) || TYPE_HAS_MUTABLE_P (type))
CLASSTYPE_HAS_MUTABLE (t) = 1;
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index a0b39bdb585..06b51b9e71c 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1286,9 +1286,13 @@ add_decl_to_level (decl, b)
b->names = decl;
b->names_size++;
- /* If appropriate, add decl to separate list of statics */
+ /* If appropriate, add decl to separate list of statics. We
+ include extern variables because they might turn out to be
+ static later. It's OK for this list to contain a few false
+ positives. */
if (b->namespace_p)
- if ((TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
+ if ((TREE_CODE (decl) == VAR_DECL
+ && (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
|| (TREE_CODE (decl) == FUNCTION_DECL
&& (!TREE_PUBLIC (decl) || DECL_DECLARED_INLINE_P (decl))))
VARRAY_PUSH_TREE (b->static_decls, decl);
@@ -8431,6 +8435,7 @@ static tree
check_initializer (tree decl, tree init, int flags, tree *cleanup)
{
tree type = TREE_TYPE (decl);
+ tree init_code = NULL;
/* If `start_decl' didn't like having an initialization, ignore it now. */
if (init != NULL_TREE && DECL_INITIAL (decl) == NULL_TREE)
@@ -8541,7 +8546,10 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup)
{
dont_use_constructor:
if (TREE_CODE (init) != TREE_VEC)
- init = store_init_value (decl, init);
+ {
+ init_code = store_init_value (decl, init);
+ init = NULL;
+ }
}
}
else if (DECL_EXTERNAL (decl))
@@ -8564,9 +8572,9 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup)
check_for_uninitialized_const_var (decl);
if (init && init != error_mark_node)
- init = build (INIT_EXPR, type, decl, init);
+ init_code = build (INIT_EXPR, type, decl, init);
- return init;
+ return init_code;
}
/* If DECL is not a local variable, give it RTL. */
@@ -13687,25 +13695,7 @@ xref_tag (enum tag_types tag_code, tree name, tree attributes,
if (code == ENUMERAL_TYPE)
{
error ("use of enum `%#D' without previous declaration", name);
-
- ref = make_node (ENUMERAL_TYPE);
-
- /* Give the type a default layout like unsigned int
- to avoid crashing if it does not get defined. */
- TYPE_MODE (ref) = TYPE_MODE (unsigned_type_node);
- TYPE_ALIGN (ref) = TYPE_ALIGN (unsigned_type_node);
- TYPE_USER_ALIGN (ref) = 0;
- TREE_UNSIGNED (ref) = 1;
- TYPE_PRECISION (ref) = TYPE_PRECISION (unsigned_type_node);
- TYPE_MIN_VALUE (ref) = TYPE_MIN_VALUE (unsigned_type_node);
- TYPE_MAX_VALUE (ref) = TYPE_MAX_VALUE (unsigned_type_node);
-
- /* Enable us to recognize when a type is created in class context.
- To do nested classes correctly, this should probably be cleared
- out when we leave this classes scope. Currently this in only
- done in `start_enum'. */
-
- pushtag (name, ref, globalize);
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
}
else
{
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 55613700d3b..50bb3e2fa79 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1851,7 +1851,11 @@ maybe_emit_vtables (tree ctype)
import_export_vtable (vtbl, ctype, 1);
mark_vtable_entries (vtbl);
if (TREE_TYPE (DECL_INITIAL (vtbl)) == 0)
- store_init_value (vtbl, DECL_INITIAL (vtbl));
+ {
+ /* It had better be all done at compile-time. */
+ if (store_init_value (vtbl, DECL_INITIAL (vtbl)))
+ abort ();
+ }
if (write_symbols == DWARF_DEBUG || write_symbols == DWARF2_DEBUG)
{
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 1090f556bc6..f3fa9aa93f7 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -390,6 +390,9 @@ perform_member_init (tree member, tree init)
/* member traversal: note it leaves init NULL */
else if (TREE_CODE (type) == REFERENCE_TYPE)
pedwarn ("uninitialized reference member `%D'", member);
+ else if (CP_TYPE_CONST_P (type))
+ pedwarn ("uninitialized member '%D' with 'const' type '%T'",
+ member, type);
}
else if (TREE_CODE (init) == TREE_LIST)
{
@@ -1286,8 +1289,9 @@ expand_aggr_init_1 (binfo, true_exp, exp, init, flags)
/* If store_init_value returns NULL_TREE, the INIT has been
record in the DECL_INITIAL for EXP. That means there's
nothing more we have to do. */
- if (store_init_value (exp, init))
- finish_expr_stmt (build (INIT_EXPR, type, exp, init));
+ init = store_init_value (exp, init);
+ if (init)
+ finish_expr_stmt (init);
return;
}
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index b063f42a9f9..d80463213a0 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -296,6 +296,108 @@ cxx_incomplete_type_error (value, type)
}
+/* The recursive part of split_nonconstant_init. DEST is an lvalue
+ expression to which INIT should be assigned. INIT is a CONSTRUCTOR.
+ PCODE is a pointer to the tail of a chain of statements being emitted.
+ The return value is the new tail of that chain after new statements
+ are generated. */
+
+static tree *
+split_nonconstant_init_1 (tree dest, tree init, tree *pcode)
+{
+ tree *pelt, elt, type = TREE_TYPE (dest);
+ tree sub, code, inner_type = NULL;
+ bool array_type_p = false;
+
+ pelt = &CONSTRUCTOR_ELTS (init);
+ switch (TREE_CODE (type))
+ {
+ case ARRAY_TYPE:
+ inner_type = TREE_TYPE (type);
+ array_type_p = true;
+ /* FALLTHRU */
+
+ case RECORD_TYPE:
+ case UNION_TYPE:
+ case QUAL_UNION_TYPE:
+ while ((elt = *pelt))
+ {
+ tree field_index = TREE_PURPOSE (elt);
+ tree value = TREE_VALUE (elt);
+
+ if (!array_type_p)
+ inner_type = TREE_TYPE (field_index);
+
+ if (TREE_CODE (value) == CONSTRUCTOR)
+ {
+ if (array_type_p)
+ sub = build (ARRAY_REF, inner_type, dest, field_index);
+ else
+ sub = build (COMPONENT_REF, inner_type, dest, field_index);
+
+ pcode = split_nonconstant_init_1 (sub, value, pcode);
+ }
+ else if (!initializer_constant_valid_p (value, inner_type))
+ {
+ *pelt = TREE_CHAIN (elt);
+
+ if (array_type_p)
+ sub = build (ARRAY_REF, inner_type, dest, field_index);
+ else
+ sub = build (COMPONENT_REF, inner_type, dest, field_index);
+
+ code = build (MODIFY_EXPR, inner_type, sub, value);
+ code = build_stmt (EXPR_STMT, code);
+
+ *pcode = code;
+ pcode = &TREE_CHAIN (code);
+ continue;
+ }
+ pelt = &TREE_CHAIN (elt);
+ }
+ break;
+
+ case VECTOR_TYPE:
+ if (!initializer_constant_valid_p (init, type))
+ {
+ CONSTRUCTOR_ELTS (init) = NULL;
+ code = build (MODIFY_EXPR, type, dest, init);
+ code = build_stmt (EXPR_STMT, code);
+ pcode = &TREE_CHAIN (code);
+ }
+ break;
+
+ default:
+ abort ();
+ }
+
+ return pcode;
+}
+
+/* A subroutine of store_init_value. Splits non-constant static
+ initializer INIT into a constant part and generates code to
+ perform the non-constant part of the initialization to DEST.
+ Returns the code for the runtime init. */
+
+static tree
+split_nonconstant_init (tree dest, tree init)
+{
+ tree code;
+
+ if (TREE_CODE (init) == CONSTRUCTOR)
+ {
+ code = build_stmt (COMPOUND_STMT, NULL_TREE);
+ split_nonconstant_init_1 (dest, init, &COMPOUND_BODY (code));
+ code = build1 (STMT_EXPR, void_type_node, code);
+ TREE_SIDE_EFFECTS (code) = 1;
+ DECL_INITIAL (dest) = init;
+ }
+ else
+ code = build (INIT_EXPR, TREE_TYPE (dest), dest, init);
+
+ return code;
+}
+
/* Perform appropriate conversions on the initial value of a variable,
store it in the declaration DECL,
and print any error messages that are appropriate.
@@ -311,9 +413,8 @@ cxx_incomplete_type_error (value, type)
into a CONSTRUCTOR and use standard initialization techniques.
Perhaps a warning should be generated?
- Returns value of initializer if initialization could not be
- performed for static variable. In that case, caller must do
- the storing. */
+ Returns code to be executed if initialization could not be performed
+ for static variable. In that case, caller must emit the code. */
tree
store_init_value (decl, init)
@@ -385,11 +486,11 @@ store_init_value (decl, init)
constructing never make it into DECL_INITIAL, and passes 'init' to
build_aggr_init without checking DECL_INITIAL. So just return. */
else if (TYPE_NEEDS_CONSTRUCTING (type))
- return value;
+ return build (INIT_EXPR, type, decl, value);
else if (TREE_STATIC (decl)
&& (! TREE_CONSTANT (value)
|| ! initializer_constant_valid_p (value, TREE_TYPE (value))))
- return value;
+ return split_nonconstant_init (decl, value);
/* Store the VALUE in DECL_INITIAL. If we're building a
statement-tree we will actually expand the initialization later
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 386e0640ba3..b586115b35d 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -1122,9 +1122,6 @@ do_pragma (pfile)
if (pfile->cb.line_change)
(*pfile->cb.line_change) (pfile, pragma_token, false);
(*p->u.handler) (pfile);
- if (pfile->cb.line_change)
- (*pfile->cb.line_change) (pfile, pfile->cur_token, false);
-
}
else if (pfile->cb.def_pragma)
{
diff --git a/gcc/cse.c b/gcc/cse.c
index 8cc10fadef8..d4130988a3a 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -3853,6 +3853,23 @@ fold_rtx (x, insn)
|| (new_cost == old_cost && CONSTANT_P (XEXP (x, i))))
break;
+ /* It's not safe to substitute the operand of a conversion
+ operator with a constant, as the conversion's identity
+ depends upon the mode of it's operand. This optimization
+ is handled by the call to simplify_unary_operation. */
+ if (GET_RTX_CLASS (code) == '1'
+ && GET_MODE (replacements[j]) != mode_arg0
+ && (code == ZERO_EXTEND
+ || code == SIGN_EXTEND
+ || code == TRUNCATE
+ || code == FLOAT_TRUNCATE
+ || code == FLOAT_EXTEND
+ || code == FLOAT
+ || code == FIX
+ || code == UNSIGNED_FLOAT
+ || code == UNSIGNED_FIX))
+ continue;
+
if (validate_change (insn, &XEXP (x, i), replacements[j], 0))
break;
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index 8a8b5616082..460921418d1 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -796,6 +796,11 @@ dbxout_type_fields (type)
field that we can support. */
for (tem = TYPE_FIELDS (type); tem; tem = TREE_CHAIN (tem))
{
+
+ /* If on of the nodes is an error_mark or its type is then return early. */
+ if (tem == error_mark_node || TREE_TYPE (tem) == error_mark_node)
+ return;
+
/* Omit here local type decls until we know how to support them. */
if (TREE_CODE (tem) == TYPE_DECL
/* Omit fields whose position or size are variable or too large to
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 840bbd0956d..6cbaa106b13 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -1037,9 +1037,7 @@ Compound expressions, conditional expressions and casts are allowed as
lvalues provided their operands are lvalues. This means that you can take
their addresses or store values into them.
-Standard C++ allows compound expressions and conditional expressions as
-lvalues, and permits casts to reference type, so use of this extension
-is deprecated for C++ code.
+All these extensions are deprecated.
For example, a compound expression can be assigned, provided the last
expression in the sequence is an lvalue. These two expressions are
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index d8e355ca55a..4ec3836635a 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -4223,8 +4223,8 @@ exactly determine which path is taken more often.
@item -fnew-ra
@opindex fnew-ra
Use a graph coloring register allocator. Currently this option is meant
-for testing, so we are interested to hear about miscompilations with
-@option{-fnew-ra}.
+only for testing. Users should not specify this option, since it is not
+yet ready for production use.
@item -ftracer
@opindex ftracer
@@ -7864,7 +7864,8 @@ Tune to @var{cpu-type} everything applicable about the generated code, except
for the ABI and the set of available instructions. The choices for
@var{cpu-type} are @samp{i386}, @samp{i486}, @samp{i586}, @samp{i686},
@samp{pentium}, @samp{pentium-mmx}, @samp{pentiumpro}, @samp{pentium2},
-@samp{pentium3}, @samp{pentium4}, @samp{k6}, @samp{k6-2}, @samp{k6-3},
+@samp{pentium3}, @samp{pentium4}, @samp{prescott}, @samp{nocona},
+@samp{k6}, @samp{k6-2}, @samp{k6-3},
@samp{athlon}, @samp{athlon-tbird}, @samp{athlon-4}, @samp{athlon-xp},
@samp{athlon-mp}, @samp{winchip-c6}, @samp{winchip2} and @samp{c3}.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index ca151906a00..06a24791055 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -1,6 +1,6 @@
/* Output Dwarf2 format symbol table information from the GNU C compiler.
- Copyright (C) 1992, 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
+ Copyright (C) 1992, 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+ 2003, 2004 Free Software Foundation, Inc.
Contributed by Gary Funck (gary@intrepid.com).
Derived from DWARF 1 implementation of Ron Guilmette (rfg@monkeys.com).
Extensively modified by Jason Merrill (jason@cygnus.com).
@@ -2233,7 +2233,7 @@ typedef enum
dw_val_class_const,
dw_val_class_unsigned_const,
dw_val_class_long_long,
- dw_val_class_float,
+ dw_val_class_vec,
dw_val_class_flag,
dw_val_class_die_ref,
dw_val_class_fde_ref,
@@ -2253,14 +2253,15 @@ typedef struct dw_long_long_struct
}
dw_long_long_const;
-/* Describe a floating point constant value. */
+/* Describe a floating point constant value, or a vector constant value. */
-typedef struct dw_fp_struct
+typedef struct dw_vec_struct
{
- long *array;
+ unsigned char *array;
unsigned length;
+ unsigned elt_size;
}
-dw_float_const;
+dw_vec_const;
/* The dw_val_node describes an attribute's value, as it is
represented internally. */
@@ -2277,7 +2278,7 @@ typedef struct dw_val_struct
long int val_int;
long unsigned val_unsigned;
dw_long_long_const val_long_long;
- dw_float_const val_float;
+ dw_vec_const val_vec;
struct
{
dw_die_ref die;
@@ -3523,9 +3524,10 @@ static void add_AT_long_long PARAMS ((dw_die_ref,
enum dwarf_attribute,
unsigned long,
unsigned long));
-static void add_AT_float PARAMS ((dw_die_ref,
+static void add_AT_vec PARAMS ((dw_die_ref,
enum dwarf_attribute,
- unsigned, long *));
+ unsigned int, unsigned int,
+ unsigned char *));
static void add_AT_string PARAMS ((dw_die_ref,
enum dwarf_attribute,
const char *));
@@ -3680,6 +3682,11 @@ static void add_const_value_attribute PARAMS ((dw_die_ref, rtx));
static rtx rtl_for_decl_location PARAMS ((tree));
static void add_location_or_const_value_attribute PARAMS ((dw_die_ref, tree));
static void tree_add_const_value_attribute PARAMS ((dw_die_ref, tree));
+static void insert_int PARAMS ((HOST_WIDE_INT,
+ unsigned, unsigned char *));
+static HOST_WIDE_INT extract_int PARAMS ((const unsigned char *,
+ unsigned));
+static void insert_float PARAMS ((rtx, unsigned char *));
static void add_name_attribute PARAMS ((dw_die_ref, const char *));
static void add_bound_info PARAMS ((dw_die_ref,
enum dwarf_attribute, tree));
@@ -4527,19 +4534,21 @@ add_AT_long_long (die, attr_kind, val_hi, val_low)
/* Add a floating point attribute value to a DIE and return it. */
static inline void
-add_AT_float (die, attr_kind, length, array)
+add_AT_vec (die, attr_kind, length, elt_size, array)
dw_die_ref die;
enum dwarf_attribute attr_kind;
- unsigned length;
- long *array;
+ unsigned int length;
+ unsigned int elt_size;
+ unsigned char *array;
{
dw_attr_ref attr = (dw_attr_ref) xmalloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
- attr->dw_attr_val.val_class = dw_val_class_float;
- attr->dw_attr_val.v.val_float.length = length;
- attr->dw_attr_val.v.val_float.array = array;
+ attr->dw_attr_val.val_class = dw_val_class_vec;
+ attr->dw_attr_val.v.val_vec.length = length;
+ attr->dw_attr_val.v.val_vec.elt_size = elt_size;
+ attr->dw_attr_val.v.val_vec.array = array;
add_dwarf_attr (die, attr);
}
@@ -5001,8 +5010,8 @@ free_AT (a)
free (a->dw_attr_val.v.val_lbl_id);
break;
- case dw_val_class_float:
- free (a->dw_attr_val.v.val_float.array);
+ case dw_val_class_vec:
+ free (a->dw_attr_val.v.val_vec.array);
break;
default:
@@ -5285,8 +5294,8 @@ print_die (die, outfile)
a->dw_attr_val.v.val_long_long.hi,
a->dw_attr_val.v.val_long_long.low);
break;
- case dw_val_class_float:
- fprintf (outfile, "floating-point constant");
+ case dw_val_class_vec:
+ fprintf (outfile, "floating-point or vector constant");
break;
case dw_val_class_flag:
fprintf (outfile, "%u", AT_flag (a));
@@ -5496,8 +5505,8 @@ attr_checksum (at, ctx, mark)
case dw_val_class_long_long:
CHECKSUM (at->dw_attr_val.v.val_long_long);
break;
- case dw_val_class_float:
- CHECKSUM (at->dw_attr_val.v.val_float);
+ case dw_val_class_vec:
+ CHECKSUM (at->dw_attr_val.v.val_vec);
break;
case dw_val_class_flag:
CHECKSUM (at->dw_attr_val.v.val_flag);
@@ -5594,7 +5603,6 @@ same_dw_val_p (v1, v2, mark)
{
dw_loc_descr_ref loc1, loc2;
rtx r1, r2;
- unsigned i;
if (v1->val_class != v2->val_class)
return 0;
@@ -5608,12 +5616,13 @@ same_dw_val_p (v1, v2, mark)
case dw_val_class_long_long:
return v1->v.val_long_long.hi == v2->v.val_long_long.hi
&& v1->v.val_long_long.low == v2->v.val_long_long.low;
- case dw_val_class_float:
- if (v1->v.val_float.length != v2->v.val_float.length)
+ case dw_val_class_vec:
+ if (v1->v.val_vec.length != v2->v.val_vec.length
+ || v1->v.val_vec.elt_size != v2->v.val_vec.elt_size)
+ return 0;
+ if (memcmp (v1->v.val_vec.array, v2->v.val_vec.array,
+ v1->v.val_vec.length * v1->v.val_vec.elt_size))
return 0;
- for (i = 0; i < v1->v.val_float.length; i++)
- if (v1->v.val_float.array[i] != v2->v.val_float.array[i])
- return 0;
return 1;
case dw_val_class_flag:
return v1->v.val_flag == v2->v.val_flag;
@@ -6240,8 +6249,9 @@ size_of_die (die)
case dw_val_class_long_long:
size += 1 + 2*HOST_BITS_PER_LONG/HOST_BITS_PER_CHAR; /* block */
break;
- case dw_val_class_float:
- size += 1 + a->dw_attr_val.v.val_float.length * 4; /* block */
+ case dw_val_class_vec:
+ size += 1 + (a->dw_attr_val.v.val_vec.length
+ * a->dw_attr_val.v.val_vec.elt_size); /* block */
break;
case dw_val_class_flag:
size += 1;
@@ -6437,7 +6447,7 @@ value_format (a)
}
case dw_val_class_long_long:
return DW_FORM_block1;
- case dw_val_class_float:
+ case dw_val_class_vec:
return DW_FORM_block1;
case dw_val_class_flag:
return DW_FORM_flag;
@@ -6717,16 +6727,24 @@ output_die (die)
}
break;
- case dw_val_class_float:
+ case dw_val_class_vec:
{
+ unsigned int elt_size = a->dw_attr_val.v.val_vec.elt_size;
+ unsigned int len = a->dw_attr_val.v.val_vec.length;
unsigned int i;
+ unsigned char *p;
- dw2_asm_output_data (1, a->dw_attr_val.v.val_float.length * 4,
- "%s", name);
-
- for (i = 0; i < a->dw_attr_val.v.val_float.length; i++)
- dw2_asm_output_data (4, a->dw_attr_val.v.val_float.array[i],
- "fp constant word %u", i);
+ dw2_asm_output_data (1, len * elt_size, "%s", name);
+ if (elt_size > sizeof (HOST_WIDE_INT))
+ {
+ elt_size /= 2;
+ len *= 2;
+ }
+ for (i = 0, p = a->dw_attr_val.v.val_vec.array;
+ i < len;
+ i++, p += elt_size)
+ dw2_asm_output_data (elt_size, extract_int (p, elt_size),
+ "fp or vector constant word %u", i);
break;
}
@@ -9058,6 +9076,81 @@ add_data_member_location_attribute (die, decl)
add_AT_loc (die, DW_AT_data_member_location, loc_descr);
}
+/* Writes integer values to dw_vec_const array. */
+
+static void
+insert_int (val, size, dest)
+ HOST_WIDE_INT val;
+ unsigned int size;
+ unsigned char *dest;
+{
+ while (size != 0)
+ {
+ *dest++ = val & 0xff;
+ val >>= 8;
+ --size;
+ }
+}
+
+/* Reads integers from dw_vec_const array. Inverse of insert_int. */
+
+static HOST_WIDE_INT
+extract_int (src, size)
+ const unsigned char *src;
+ unsigned int size;
+{
+ HOST_WIDE_INT val = 0;
+
+ src += size;
+ while (size != 0)
+ {
+ val <<= 8;
+ val |= *--src & 0xff;
+ --size;
+ }
+ return val;
+}
+
+/* Writes floating point values to dw_vec_const array. */
+
+static void
+insert_float (rtl, array)
+ rtx rtl;
+ unsigned char *array;
+{
+ REAL_VALUE_TYPE rv;
+ long val[4];
+ int i;
+
+ REAL_VALUE_FROM_CONST_DOUBLE (rv, rtl);
+ switch (GET_MODE (rtl))
+ {
+ case SFmode:
+ REAL_VALUE_TO_TARGET_SINGLE (rv, val[0]);
+ break;
+
+ case DFmode:
+ REAL_VALUE_TO_TARGET_DOUBLE (rv, val);
+ break;
+
+ case XFmode:
+ case TFmode:
+ REAL_VALUE_TO_TARGET_LONG_DOUBLE (rv, val);
+ break;
+
+ default:
+ abort ();
+ }
+
+ /* REAL_VALUE_TO_TARGET_* puts 32-bit pieces in each long.
+ Pack them. */
+ for (i = 0; i < GET_MODE_SIZE (GET_MODE (rtl)) / 4; i++)
+ {
+ insert_int (val[i], 4, array);
+ array += 4;
+ }
+}
+
/* Attach an DW_AT_const_value attribute for a variable or a parameter which
does not have a "location" either in memory or in a register. These
things can arise in GNU C when a constant is passed as an actual parameter
@@ -9107,31 +9200,11 @@ add_const_value_attribute (die, rtl)
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
{
- unsigned length = GET_MODE_SIZE (mode) / 4;
- long *array = (long *) xmalloc (sizeof (long) * length);
- REAL_VALUE_TYPE rv;
-
- REAL_VALUE_FROM_CONST_DOUBLE (rv, rtl);
- switch (mode)
- {
- case SFmode:
- REAL_VALUE_TO_TARGET_SINGLE (rv, array[0]);
- break;
+ unsigned int length = GET_MODE_SIZE (mode);
+ unsigned char *array = xmalloc (length);
- case DFmode:
- REAL_VALUE_TO_TARGET_DOUBLE (rv, array);
- break;
-
- case XFmode:
- case TFmode:
- REAL_VALUE_TO_TARGET_LONG_DOUBLE (rv, array);
- break;
-
- default:
- abort ();
- }
-
- add_AT_float (die, DW_AT_const_value, length, array);
+ insert_float (rtl, array);
+ add_AT_vec (die, DW_AT_const_value, length / 4, 4, array);
}
else
{
@@ -9145,6 +9218,68 @@ add_const_value_attribute (die, rtl)
}
break;
+ case CONST_VECTOR:
+ {
+ enum machine_mode mode = GET_MODE (rtl);
+ unsigned int elt_size = GET_MODE_UNIT_SIZE (mode);
+ unsigned int length = CONST_VECTOR_NUNITS (rtl);
+ unsigned char *array = xmalloc (length * elt_size);
+ unsigned int i;
+ unsigned char *p;
+
+ if (GET_MODE_CLASS (mode) == MODE_VECTOR_INT)
+ {
+ for (i = 0, p = array; i < length; i++, p += elt_size)
+ {
+ rtx elt = CONST_VECTOR_ELT (rtl, i);
+ HOST_WIDE_INT lo, hi;
+ if (GET_CODE (elt) == CONST_INT)
+ {
+ lo = INTVAL (elt);
+ hi = -(lo < 0);
+ }
+ else if (GET_CODE (elt) == CONST_DOUBLE)
+ {
+ lo = CONST_DOUBLE_LOW (elt);
+ hi = CONST_DOUBLE_HIGH (elt);
+ }
+ else
+ abort ();
+
+ if (elt_size <= sizeof (HOST_WIDE_INT))
+ insert_int (lo, elt_size, p);
+ else if (elt_size == 2 * sizeof (HOST_WIDE_INT))
+ {
+ unsigned char *p0 = p;
+ unsigned char *p1 = p + sizeof (HOST_WIDE_INT);
+
+ if (WORDS_BIG_ENDIAN)
+ {
+ p0 = p1;
+ p1 = p;
+ }
+ insert_int (lo, sizeof (HOST_WIDE_INT), p0);
+ insert_int (hi, sizeof (HOST_WIDE_INT), p1);
+ }
+ else
+ abort ();
+ }
+ }
+ else if (GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT)
+ {
+ for (i = 0, p = array; i < length; i++, p += elt_size)
+ {
+ rtx elt = CONST_VECTOR_ELT (rtl, i);
+ insert_float (elt, p);
+ }
+ }
+ else
+ abort ();
+
+ add_AT_vec (die, DW_AT_const_value, length, elt_size, array);
+ }
+ break;
+
case CONST_STRING:
add_AT_string (die, DW_AT_const_value, XSTR (rtl, 0));
break;
@@ -9431,6 +9566,7 @@ add_location_or_const_value_attribute (die, decl)
case CONST_INT:
case CONST_DOUBLE:
+ case CONST_VECTOR:
case CONST_STRING:
case SYMBOL_REF:
case LABEL_REF:
diff --git a/gcc/except.c b/gcc/except.c
index b6f851bcbfb..b3093ce50ad 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -3292,8 +3292,18 @@ collect_one_action_chain (ar_hash, region)
/* An exception specification adds its filter to the
beginning of the chain. */
next = collect_one_action_chain (ar_hash, region->outer);
- return add_action_record (ar_hash, region->u.allowed.filter,
- next < 0 ? 0 : next);
+
+ /* If there is no next action, terminate the chain. */
+ if (next == -1)
+ next = 0;
+ /* If all outer actions are cleanups or must_not_throw,
+ we'll have no action record for it, since we had wanted
+ to encode these states in the call-site record directly.
+ Add a cleanup action to the chain to catch these. */
+ else if (next <= 0)
+ next = add_action_record (ar_hash, 0, 0);
+
+ return add_action_record (ar_hash, region->u.allowed.filter, next);
case ERT_MUST_NOT_THROW:
/* A must-not-throw region with no inner handlers or cleanups
diff --git a/gcc/expr.c b/gcc/expr.c
index fdf6570bb52..67172124fa1 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -130,6 +130,8 @@ struct store_by_pieces
};
static rtx enqueue_insn PARAMS ((rtx, rtx));
+static rtx mark_queue PARAMS ((void));
+static void emit_insns_enqueued_after_mark PARAMS ((rtx));
static unsigned HOST_WIDE_INT move_by_pieces_ninsns
PARAMS ((unsigned HOST_WIDE_INT,
unsigned int));
@@ -504,13 +506,31 @@ queued_subexp_p (x)
}
}
-/* Perform all the pending incrementations. */
+/* Retrieve a mark on the queue. */
+
+static rtx
+mark_queue ()
+{
+ return pending_chain;
+}
-void
-emit_queue ()
+/* Perform all the pending incrementations that have been enqueued
+ after MARK was retrieved. If MARK is null, perform all the
+ pending incrementations. */
+
+static void
+emit_insns_enqueued_after_mark (mark)
+ rtx mark;
{
rtx p;
- while ((p = pending_chain))
+
+ /* The marked incrementation may have been emitted in the meantime
+ through a call to emit_queue. In this case, the mark is not valid
+ anymore so do nothing. */
+ if (mark && ! QUEUED_BODY (mark))
+ return;
+
+ while ((p = pending_chain) != mark)
{
rtx body = QUEUED_BODY (p);
@@ -537,9 +557,18 @@ emit_queue ()
break;
}
+ QUEUED_BODY (p) = 0;
pending_chain = QUEUED_NEXT (p);
}
}
+
+/* Perform all the pending incrementations. */
+
+void
+emit_queue ()
+{
+ emit_insns_enqueued_after_mark (NULL_RTX);
+}
/* Copy data from FROM to TO, where the machine modes are not the same.
Both modes may be integer, or both may be floating.
@@ -4435,6 +4464,7 @@ store_expr (exp, target, want_value)
int want_value;
{
rtx temp;
+ rtx mark = mark_queue ();
int dont_return_target = 0;
int dont_store_target = 0;
@@ -4644,7 +4674,11 @@ store_expr (exp, target, want_value)
temp, TREE_UNSIGNED (TREE_TYPE (exp)));
/* If value was not generated in the target, store it there.
- Convert the value to TARGET's type first if necessary.
+ Convert the value to TARGET's type first if necessary and emit the
+ pending incrementations that have been queued when expanding EXP.
+ Note that we cannot emit the whole queue blindly because this will
+ effectively disable the POST_INC optimization later.
+
If TEMP and TARGET compare equal according to rtx_equal_p, but
one or both of them are volatile memory refs, we have to distinguish
two cases:
@@ -4673,7 +4707,9 @@ store_expr (exp, target, want_value)
bit-initialized. */
&& expr_size (exp) != const0_rtx)
{
+ emit_insns_enqueued_after_mark (mark);
target = protect_from_queue (target, 1);
+ temp = protect_from_queue (temp, 0);
if (GET_MODE (temp) != GET_MODE (target)
&& GET_MODE (temp) != VOIDmode)
{
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog
index c42411557e5..e188d012ba8 100644
--- a/gcc/f/ChangeLog
+++ b/gcc/f/ChangeLog
@@ -1,3 +1,20 @@
+2004-03-21 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * g77.texi (Aligned Data): Remove obsolete paragraph including a
+ broken link.
+ (Floating-point Errors): Remove links to http://www.validgh.com/
+ which was "hijacked".
+ (Language): Fix link to Fortran books.
+ (Projects): Remove obsolete paragraph including a broken link to
+ ftp://alpha.gnu.org/gnu/g77/projects/.
+ (Trouble): Remove obsolete paragraph including a broken link to
+ ftp://alpha.gnu.org/g77.plan.
+
+ * invoke.texi (Overall Options): Remove broken reference to
+ rat7.uue (which was of dubious copyright status anyways).
+
+ * root.texi (www-burley): Fix URL.
+
2004-02-14 Release Manager
* GCC 3.3.3 Released.
diff --git a/gcc/f/g77.texi b/gcc/f/g77.texi
index a7cd96bc0fb..543724f4e8e 100644
--- a/gcc/f/g77.texi
+++ b/gcc/f/g77.texi
@@ -3,7 +3,7 @@
@setfilename g77.info
@set last-update 2003-05-13
-@set copyrights-g77 1995,1996,1997,1998,1999,2000,2001,2002,2003
+@set copyrights-g77 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
@include root.texi
@@ -849,7 +849,7 @@ by GNU Fortran.
@cindex textbooks
(If you need a text on Fortran,
a few freely available electronic references have pointers from
-@uref{http://www.fortran.com/fortran/Books/}. There is a `cooperative
+@uref{http://www.fortran.com/F/books.html}. There is a `cooperative
net project', @cite{User Notes on Fortran Programming} at
@uref{ftp://vms.huji.ac.il/fortran/} and mirrors elsewhere; some of this
material might not apply specifically to @command{g77}.)
@@ -8000,13 +8000,6 @@ Progress is being made on making this work
@command{gcc}, and some of the relevant operating systems
(such as GNU/Linux).
-@cindex alignment testing
-@cindex testing alignment
-A package that tests the degree to which a Fortran compiler
-(such as @command{g77})
-aligns 64-bit floating-point variables and arrays
-is available at @uref{ftp://alpha.gnu.org/gnu/g77/align/}.
-
@node Prefer Automatic Uninitialized Variables
@subsection Prefer Automatic Uninitialized Variables
@@ -8088,10 +8081,6 @@ Some of these problems are due to bugs in other software, some are
missing features that are too much work to add, and some are places
where people's opinions differ as to what is best.
-To find out about major bugs discovered in the current release and
-possible workarounds for them, see
-@uref{ftp://alpha.gnu.org/g77.plan}.
-
(Note that some of this portion of the manual is lifted
directly from the @command{gcc} manual, with minor modifications
to tailor it to users of @command{g77}.
@@ -8627,9 +8616,7 @@ Goldberg, `What Every Computer Scientist Should Know About
Floating-Point Arithmetic', Computing Surveys, 23, March 1991, pp.@:
5-48.
An online version is available at
-@uref{http://docs.sun.com/},
-and there is a supplemented version, in PostScript form, at
-@uref{http://www.validgh.com/goldberg/paper.ps}.
+@uref{http://docs.sun.com/}.
Information related to the IEEE 754
floating-point standard by a leading light can be found at
@@ -8642,9 +8629,7 @@ and library code for GNU/Linux x86 systems.
The supplement to the PostScript-formatted Goldberg document,
referenced above, is available in HTML format.
-See `Differences Among IEEE 754 Implementations' by Doug Priest,
-available online at
-@uref{http://www.validgh.com/goldberg/addendum.html}.
+See `Differences Among IEEE 754 Implementations' by Doug Priest.
This document explores some of the issues surrounding computing
of extended (80-bit) results on processors such as the x86,
especially when those results are arbitrarily truncated
@@ -10777,8 +10762,6 @@ are passed via this mechanism.
If you want to contribute to @command{g77} by doing research,
design, specification, documentation, coding, or testing,
the following information should give you some ideas.
-More relevant information might be available from
-@uref{ftp://alpha.gnu.org/gnu/g77/projects/}.
@menu
* Efficiency:: Make @command{g77} itself compile code faster.
diff --git a/gcc/f/invoke.texi b/gcc/f/invoke.texi
index 50c7ca42e73..664f1a340ef 100644
--- a/gcc/f/invoke.texi
+++ b/gcc/f/invoke.texi
@@ -1,11 +1,11 @@
-@c Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
+@c Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004
@c Free Software Foundation, Inc.
@c This is part of the G77 manual.
@c For copying conditions, see the file g77.texi.
@ignore
@c man begin COPYRIGHT
-Copyright @copyright{} 1996, 1997, 1998, 1999, 2000, 2001, 2002
+Copyright @copyright{} 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004
Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
@@ -300,9 +300,7 @@ preprocessor directive must be used instead.
Ratfor source code, which must be preprocessed by the @command{ratfor}
command, which is available separately (as it is not yet part of the GNU
Fortran distribution).
-One version in Fortran, adapted for use with @command{g77} is at
-@uref{ftp://members.aol.com/n8tm/rat7.uue} (of uncertain copyright
-status). Another, public domain version in C is at
+A public domain version in C is at
@uref{http://sepwww.stanford.edu/sep/prof/ratfor.shar.2}.
@end table
diff --git a/gcc/f/root.texi b/gcc/f/root.texi
index d8619cc376d..1956abca3c3 100644
--- a/gcc/f/root.texi
+++ b/gcc/f/root.texi
@@ -11,4 +11,4 @@
@set which-gcc GCC
@set email-burley craig@@jcb-sc.com
-@set www-burley http://world.std.com/%7Eburley
+@set www-burley http://world.std.com/%7Eburley/
diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x
index 0f20f3a5806..c2d27b0414b 100644
--- a/gcc/fixinc/fixincl.x
+++ b/gcc/fixinc/fixincl.x
@@ -5,7 +5,7 @@
* files which are fixed to work correctly with ANSI C and placed in a
* directory that GNU C will search.
*
- * This file contains 163 fixup descriptions.
+ * This file contains 164 fixup descriptions.
*
* See README for more information.
*
@@ -3808,6 +3808,41 @@ static const char* apzNodeent_SyntaxPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Obstack_Lvalue_Cast fix
+ */
+tSCC zObstack_Lvalue_CastName[] =
+ "obstack_lvalue_cast";
+
+/*
+ * File name selection pattern
+ */
+tSCC zObstack_Lvalue_CastList[] =
+ "|obstack.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+#define apzObstack_Lvalue_CastMachs (const char**)NULL
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zObstack_Lvalue_CastSelect0[] =
+ "\\*\\(\\(([^()]*)\\*\\)(.*)\\)\\+\\+ = \\(([^()]*)\\)";
+
+#define OBSTACK_LVALUE_CAST_TEST_CT 1
+static tTestDesc aObstack_Lvalue_CastTests[] = {
+ { TT_EGREP, zObstack_Lvalue_CastSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Obstack_Lvalue_Cast
+ */
+static const char* apzObstack_Lvalue_CastPatch[] = {
+ "format",
+ "((*((%1*)%2) = (%3)), (%2 += sizeof (%1)))",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Osf_Namespace_A fix
*/
tSCC zOsf_Namespace_AName[] =
@@ -6418,9 +6453,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
-#define REGEX_COUNT 177
+#define REGEX_COUNT 178
#define MACH_LIST_SIZE_LIMIT 334
-#define FIX_COUNT 163
+#define FIX_COUNT 164
/*
* Enumerate the fixes
@@ -6521,6 +6556,7 @@ typedef enum {
NEXT_VOLITILE_FIXIDX,
NEXT_WAIT_UNION_FIXIDX,
NODEENT_SYNTAX_FIXIDX,
+ OBSTACK_LVALUE_CAST_FIXIDX,
OSF_NAMESPACE_A_FIXIDX,
OSF_NAMESPACE_C_FIXIDX,
PTHREAD_PAGE_SIZE_FIXIDX,
@@ -7067,6 +7103,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
NODEENT_SYNTAX_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aNodeent_SyntaxTests, apzNodeent_SyntaxPatch, 0 },
+ { zObstack_Lvalue_CastName, zObstack_Lvalue_CastList,
+ apzObstack_Lvalue_CastMachs,
+ OBSTACK_LVALUE_CAST_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aObstack_Lvalue_CastTests, apzObstack_Lvalue_CastPatch, 0 },
+
{ zOsf_Namespace_AName, zOsf_Namespace_AList,
apzOsf_Namespace_AMachs,
OSF_NAMESPACE_A_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def
index 676463e24be..959cb569da0 100644
--- a/gcc/fixinc/inclhack.def
+++ b/gcc/fixinc/inclhack.def
@@ -2132,6 +2132,31 @@ fix = {
/*
+ * obstack.h used casts as lvalues.
+ *
+ * We need to change postincrements of casted pointers (which are
+ * then dereferenced and assigned into) of the form
+ *
+ * *((TYPE*)PTRVAR)++ = (VALUE)
+ *
+ * into expressions like
+ *
+ * ((*((TYPE*)PTRVAR) = (VALUE)), (PTRVAR += sizeof (TYPE)))
+ *
+ * which is correct for the cases used in obstack.h since PTRVAR is
+ * of type char * and the value of the expression is not used.
+ */
+fix = {
+ hackname = obstack_lvalue_cast;
+ files = obstack.h;
+ select = '\*\(\(([^()]*)\*\)(.*)\)\+\+ = \(([^()]*)\)';
+ c_fix = format;
+ c_fix_arg = "((*((%1*)%2) = (%3)), (%2 += sizeof (%1)))";
+ test_text = "*((void **) (h)->next_free)++ = (aptr)";
+};
+
+
+/*
* sys/lc_core.h on some versions of OSF1/4.x pollutes the namespace by
* defining regex.h related types. This causes libg++ build and usage
* failures. Fixing this correctly requires checking and modifying 3 files.
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 1a083ffba0f..199539fb202 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -6039,150 +6039,82 @@ fold (expr)
return fold (build (code, type, TREE_OPERAND (arg0, 0), tem));
}
- /* Convert foo++ == CONST into ++foo == CONST + INCR.
- First, see if one arg is constant; find the constant arg
- and the other one. */
- {
- tree constop = 0, varop = NULL_TREE;
- int constopnum = -1;
- if (TREE_CONSTANT (arg1))
- constopnum = 1, constop = arg1, varop = arg0;
- if (TREE_CONSTANT (arg0))
- constopnum = 0, constop = arg0, varop = arg1;
+ /* Convert foo++ == CONST into ++foo == CONST + INCR. */
+ if (TREE_CONSTANT (arg1)
+ && (TREE_CODE (arg0) == POSTINCREMENT_EXPR
+ || TREE_CODE (arg0) == POSTDECREMENT_EXPR)
+ /* This optimization is invalid for ordered comparisons
+ if CONST+INCR overflows or if foo+incr might overflow.
+ This optimization is invalid for floating point due to rounding.
+ For pointer types we assume overflow doesn't happen. */
+ && (POINTER_TYPE_P (TREE_TYPE (arg0))
+ || (INTEGRAL_TYPE_P (TREE_TYPE (arg0))
+ && (code == EQ_EXPR || code == NE_EXPR))))
+ {
+ tree varop, newconst;
- if (constop && TREE_CODE (varop) == POSTINCREMENT_EXPR)
- {
- /* This optimization is invalid for ordered comparisons
- if CONST+INCR overflows or if foo+incr might overflow.
- This optimization is invalid for floating point due to rounding.
- For pointer types we assume overflow doesn't happen. */
- if (POINTER_TYPE_P (TREE_TYPE (varop))
- || (! FLOAT_TYPE_P (TREE_TYPE (varop))
- && (code == EQ_EXPR || code == NE_EXPR)))
- {
- tree newconst
- = fold (build (PLUS_EXPR, TREE_TYPE (varop),
- constop, TREE_OPERAND (varop, 1)));
-
- /* Do not overwrite the current varop to be a preincrement,
- create a new node so that we won't confuse our caller who
- might create trees and throw them away, reusing the
- arguments that they passed to build. This shows up in
- the THEN or ELSE parts of ?: being postincrements. */
- varop = build (PREINCREMENT_EXPR, TREE_TYPE (varop),
- TREE_OPERAND (varop, 0),
- TREE_OPERAND (varop, 1));
-
- /* If VAROP is a reference to a bitfield, we must mask
- the constant by the width of the field. */
- if (TREE_CODE (TREE_OPERAND (varop, 0)) == COMPONENT_REF
- && DECL_BIT_FIELD(TREE_OPERAND
- (TREE_OPERAND (varop, 0), 1)))
- {
- int size
- = TREE_INT_CST_LOW (DECL_SIZE
- (TREE_OPERAND
- (TREE_OPERAND (varop, 0), 1)));
- tree mask, unsigned_type;
- unsigned int precision;
- tree folded_compare;
-
- /* First check whether the comparison would come out
- always the same. If we don't do that we would
- change the meaning with the masking. */
- if (constopnum == 0)
- folded_compare = fold (build (code, type, constop,
- TREE_OPERAND (varop, 0)));
- else
- folded_compare = fold (build (code, type,
- TREE_OPERAND (varop, 0),
- constop));
- if (integer_zerop (folded_compare)
- || integer_onep (folded_compare))
- return omit_one_operand (type, folded_compare, varop);
-
- unsigned_type = (*lang_hooks.types.type_for_size)(size, 1);
- precision = TYPE_PRECISION (unsigned_type);
- mask = build_int_2 (~0, ~0);
- TREE_TYPE (mask) = unsigned_type;
- force_fit_type (mask, 0);
- mask = const_binop (RSHIFT_EXPR, mask,
- size_int (precision - size), 0);
- newconst = fold (build (BIT_AND_EXPR,
- TREE_TYPE (varop), newconst,
- convert (TREE_TYPE (varop),
- mask)));
- }
+ if (TREE_CODE (arg0) == POSTINCREMENT_EXPR)
+ {
+ newconst = fold (build (PLUS_EXPR, TREE_TYPE (arg0),
+ arg1, TREE_OPERAND (arg0, 1)));
+ varop = build (PREINCREMENT_EXPR, TREE_TYPE (arg0),
+ TREE_OPERAND (arg0, 0),
+ TREE_OPERAND (arg0, 1));
+ }
+ else
+ {
+ newconst = fold (build (MINUS_EXPR, TREE_TYPE (arg0),
+ arg1, TREE_OPERAND (arg0, 1)));
+ varop = build (PREDECREMENT_EXPR, TREE_TYPE (arg0),
+ TREE_OPERAND (arg0, 0),
+ TREE_OPERAND (arg0, 1));
+ }
- t = build (code, type,
- (constopnum == 0) ? newconst : varop,
- (constopnum == 1) ? newconst : varop);
- return t;
- }
- }
- else if (constop && TREE_CODE (varop) == POSTDECREMENT_EXPR)
- {
- if (POINTER_TYPE_P (TREE_TYPE (varop))
- || (! FLOAT_TYPE_P (TREE_TYPE (varop))
- && (code == EQ_EXPR || code == NE_EXPR)))
- {
- tree newconst
- = fold (build (MINUS_EXPR, TREE_TYPE (varop),
- constop, TREE_OPERAND (varop, 1)));
-
- /* Do not overwrite the current varop to be a predecrement,
- create a new node so that we won't confuse our caller who
- might create trees and throw them away, reusing the
- arguments that they passed to build. This shows up in
- the THEN or ELSE parts of ?: being postdecrements. */
- varop = build (PREDECREMENT_EXPR, TREE_TYPE (varop),
- TREE_OPERAND (varop, 0),
- TREE_OPERAND (varop, 1));
-
- if (TREE_CODE (TREE_OPERAND (varop, 0)) == COMPONENT_REF
- && DECL_BIT_FIELD(TREE_OPERAND
- (TREE_OPERAND (varop, 0), 1)))
- {
- int size
- = TREE_INT_CST_LOW (DECL_SIZE
- (TREE_OPERAND
- (TREE_OPERAND (varop, 0), 1)));
- tree mask, unsigned_type;
- unsigned int precision;
- tree folded_compare;
-
- if (constopnum == 0)
- folded_compare = fold (build (code, type, constop,
- TREE_OPERAND (varop, 0)));
- else
- folded_compare = fold (build (code, type,
- TREE_OPERAND (varop, 0),
- constop));
- if (integer_zerop (folded_compare)
- || integer_onep (folded_compare))
- return omit_one_operand (type, folded_compare, varop);
-
- unsigned_type = (*lang_hooks.types.type_for_size)(size, 1);
- precision = TYPE_PRECISION (unsigned_type);
- mask = build_int_2 (~0, ~0);
- TREE_TYPE (mask) = TREE_TYPE (varop);
- force_fit_type (mask, 0);
- mask = const_binop (RSHIFT_EXPR, mask,
- size_int (precision - size), 0);
- newconst = fold (build (BIT_AND_EXPR,
- TREE_TYPE (varop), newconst,
- convert (TREE_TYPE (varop),
- mask)));
- }
- t = build (code, type,
- (constopnum == 0) ? newconst : varop,
- (constopnum == 1) ? newconst : varop);
- return t;
- }
- }
- }
+ /* If VAROP is a reference to a bitfield, we must mask
+ the constant by the width of the field. */
+ if (TREE_CODE (TREE_OPERAND (varop, 0)) == COMPONENT_REF
+ && DECL_BIT_FIELD(TREE_OPERAND (TREE_OPERAND (varop, 0), 1)))
+ {
+ tree fielddecl = TREE_OPERAND (TREE_OPERAND (varop, 0), 1);
+ int size = TREE_INT_CST_LOW (DECL_SIZE (fielddecl));
+ tree folded_compare;
+ tree mask = 0;
+
+ /* First check whether the comparison would come out
+ always the same. If we don't do that we would
+ change the meaning with the masking. */
+ folded_compare = fold (build (code, type,
+ TREE_OPERAND (varop, 0),
+ arg1));
+ if (integer_zerop (folded_compare)
+ || integer_onep (folded_compare))
+ return omit_one_operand (type, folded_compare, varop);
+
+ if (size < HOST_BITS_PER_WIDE_INT)
+ {
+ unsigned HOST_WIDE_INT lo = ((unsigned HOST_WIDE_INT) 1
+ << size) - 1;
+ mask = build_int_2 (lo, 0);
+ }
+ else if (size < 2 * HOST_BITS_PER_WIDE_INT)
+ {
+ HOST_WIDE_INT hi = ((HOST_WIDE_INT) 1
+ << (size - HOST_BITS_PER_WIDE_INT)) - 1;
+ mask = build_int_2 (~0, hi);
+ }
+
+ if (mask)
+ {
+ mask = convert (TREE_TYPE (varop), mask);
+ newconst = fold (build (BIT_AND_EXPR, TREE_TYPE (varop),
+ newconst, mask));
+ }
+ }
+
+ return fold (build (code, type, varop, newconst));
+ }
/* Change X >= C to X > (C - 1) and X < C to X <= (C - 1) if C > 0.
This transformation affects the cases which are handled in later
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 210cae29433..95b6d05c0c3 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -328,7 +328,7 @@ static void display_help PARAMS ((void));
static void add_preprocessor_option PARAMS ((const char *, int));
static void add_assembler_option PARAMS ((const char *, int));
static void add_linker_option PARAMS ((const char *, int));
-static void process_command PARAMS ((int, const char *const *));
+static void process_command PARAMS ((int, const char **));
static int execute PARAMS ((void));
static void alloc_args PARAMS ((void));
static void clear_args PARAMS ((void));
@@ -740,7 +740,7 @@ static const char *cpp_debug_options = "%{d*}";
static const char *cc1_options =
"%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
%1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*}\
- -auxbase%{c|S:%{o*:-strip %*}%{!o*: %b}}%{!c:%{!S: %b}}\
+ %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}}\
%{g*} %{O*} %{W*&pedantic*} %{w} %{std*} %{ansi}\
%{v:-version} %{pg:-p} %{p} %{f*} %{undef}\
%{Qn:-fno-ident} %{--help:--help}\
@@ -3059,7 +3059,7 @@ add_linker_option (option, len)
static void
process_command (argc, argv)
int argc;
- const char *const *argv;
+ const char **argv;
{
int i;
const char *temp;
@@ -3288,10 +3288,10 @@ process_command (argc, argv)
}
/* Convert new-style -- options to old-style. */
- translate_options (&argc, &argv);
+ translate_options (&argc, (const char *const **) &argv);
/* Do language-specific adjustment/addition of flags. */
- lang_specific_driver (&argc, &argv, &added_libraries);
+ lang_specific_driver (&argc, (const char *const **) &argv, &added_libraries);
/* Scan argv twice. Here, the first time, just count how many switches
there will be in their vector, and how many input files in theirs.
@@ -5926,12 +5926,12 @@ fatal_error (signum)
kill (getpid (), signum);
}
-extern int main PARAMS ((int, const char *const *));
+extern int main PARAMS ((int, const char **));
int
main (argc, argv)
int argc;
- const char *const *argv;
+ const char **argv;
{
size_t i;
int value;
diff --git a/gcc/reload1.c b/gcc/reload1.c
index d0f7ae0a0b7..03359286084 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -790,7 +790,7 @@ reload (first, global)
stages of reload assume that all addresses found
in the reg_equiv_* arrays were originally legitimate,
we ignore such REG_EQUIV notes.
-
+
It also can happen that a REG_EQUIV note contains a MEM
that carries the /u flag, for example when GCSE turns
the load of a constant into a move from a pseudo that
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index be512e30f6e..8100a137132 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,28 @@
+2004-03-25 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.dg/20040127-1.c: New test.
+ * gcc.dg/20040127-2.c: New test.
+
+2004-03-21 Roger Sayle <roger@eyesopen.com>
+ Kazu Hirata <kazu@cs.umass.edu>
+
+ * gcc.c-torture/execute/20040307-1.c: New test case.
+
+2004-03-21 Roger Sayle <roger@eyesopen.com>
+
+ PR target/13889
+ * gcc.c-torture/compile/pr13889.c: New test case.
+
+2004-03-13 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR middle-end/14470
+ * gcc.c-torture/execute/20040313-1.c: New test.
+
+2004-03-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/14533
+ * gcc.dg/20040311-2.c: New test.
+
2004-03-09 Mark Mitchell <mark@codesourcery.com>
PR c++/14230
diff --git a/gcc/testsuite/g++.dg/lookup/enum2.C b/gcc/testsuite/g++.dg/lookup/enum2.C
new file mode 100644
index 00000000000..054933dd9d3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/enum2.C
@@ -0,0 +1,5 @@
+// PR c++/14476
+
+struct tree_common {
+ enum tree_code code : 8; // { dg-error "" }
+};
diff --git a/gcc/testsuite/gcc.dg/const-1.c b/gcc/testsuite/gcc.dg/const-1.c
new file mode 100644
index 00000000000..40678c6431c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/const-1.c
@@ -0,0 +1,56 @@
+/* PR optimization/13472 */
+/* Origin: <p.van-hoof@qub.ac.uk> */
+
+/* Verify that the reload pass doesn't emit a store
+ to the .rodata section. */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -pedantic -march=i686" { target i686-*-* } } */
+
+
+#define MAX2(a,b) (((a)>(b)) ? (a) : (b))
+
+const int q=0, p=0;
+
+typedef struct {
+ float a;
+ float b;
+} F;
+
+F **E, *D, C = { 2.f, 1.f };
+
+void G(float);
+void H(void);
+
+int main(void)
+{
+ D = &C;
+ E = &D;
+
+ H();
+ return 0;
+}
+
+void H(void)
+{
+ int i, l=1;
+ float b, o;
+
+ if( l )
+ {
+ b = 0.3f * MAX2(0.f,E[q][p].a - E[q][p].b);
+ o = E[q][p].a;
+ if( o > 1.e-36f )
+ G(o);
+ E[q][p].a *= b;
+ }
+ else
+ b = 1.f;
+ for( i=q; i<2; ++i )
+ ;
+}
+
+void G(float o)
+{
+}
+
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 9e9e7c71f7b..546f968b3d1 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -35,6 +35,7 @@ Boston, MA 02111-1307, USA. */
#include "hashtab.h"
#include "splay-tree.h"
#include "langhooks.h"
+#include "diagnostic.h"
/* This should be eventually be generalized to other languages, but
this would require a shared function-as-trees infrastructure. */
@@ -1448,6 +1449,13 @@ optimize_inline_calls (fn)
inline_data id;
tree prev_fn;
+
+ /* There is no point in performing inlining if errors have already
+ occurred -- and we might crash if we try to inline invalid
+ code. */
+ if (errorcount || sorrycount)
+ return;
+
/* Clear out ID. */
memset (&id, 0, sizeof (id));
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 44f689cebac..4c6f74ea1c7 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -1119,6 +1119,11 @@ unroll_loop (loop, insn_count, strength_reduce_p)
unroll_type = UNROLL_MODULO;
loop_preconditioned = 1;
+ /* Preconditioning changes the loop's initial value. We set
+ it to an unknown value so that doloop_optimize won't get
+ confused. */
+ loop_info->initial_value = 0;
+
/* Clean up. */
free (labels);
}
diff --git a/gcc/version.c b/gcc/version.c
index d3be0c2b5b2..6df6c937bfe 100644
--- a/gcc/version.c
+++ b/gcc/version.c
@@ -6,7 +6,7 @@
please modify this string to indicate that, e.g. by putting your
organization's name in parentheses at the end of the string. */
-const char version_string[] = "3.3.3 20040311 (Red Hat Linux 3.3.3-3)";
+const char version_string[] = "3.3.3 20040326 (Red Hat Linux 3.3.3-4)";
/* This is the location of the online document giving instructions for
reporting bugs. If you distribute a modified version of GCC,
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index 956056dc3d7..3566217a39a 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -35,7 +35,7 @@
#include <bits/os_defines.h>
// The current version of the C++ library in compressed ISO date format.
-#define __GLIBCPP__ 20040311
+#define __GLIBCPP__ 20040326
// This is necessary until GCC supports separate template compilation.
#define _GLIBCPP_NO_TEMPLATE_EXPORT 1