4.3.0-0.6

This commit is contained in:
Jakub Jelinek 2008-01-25 17:43:01 +00:00
parent 769378652e
commit 18792bedb3
7 changed files with 423 additions and 43 deletions

View File

@ -1,2 +1,2 @@
gcc-4.3.0-20080110.tar.bz2 gcc-4.3.0-20080125.tar.bz2
fastjar-0.95.tar.gz fastjar-0.95.tar.gz

265
gcc43-cpp-pragma.patch Normal file
View File

@ -0,0 +1,265 @@
2008-01-24 Jakub Jelinek <jakub@redhat.com>
* c-ppoutput.c (scan_translation_unit): Handle CPP_PRAGMA
and CPP_PRAGMA_EOL.
* c-pragma.c (pragma_ns_name): New typedef.
(registered_pp_pragmas): New variable.
(c_pp_lookup_pragma): New function.
(c_register_pragma_1): If flag_preprocess_only, do nothing
for non-expanded pragmas, for expanded ones push pragma's
namespace and name into registered_pp_pragmas vector.
(c_invoke_pragma_handler): Register OpenMP pragmas even when
flag_preprocess_only, don't register GCC pch_preprocess
pragma if flag_preprocess_only.
* c-opts.c (c_common_init): Call init_pragma even if
flag_preprocess_only.
* c-pragma.c (c_pp_lookup_pragma): New prototype.
* config/darwin.h (DARWIN_REGISTER_TARGET_PRAGMAS): Don't call
cpp_register_pragma if flag_preprocess_only.
* gcc.dg/gomp/preprocess-1.c: New test.
--- gcc/c-ppoutput.c.jj 2007-09-07 10:29:37.000000000 +0200
+++ gcc/c-ppoutput.c 2008-01-24 12:27:31.000000000 +0100
@@ -1,6 +1,6 @@
/* Preprocess only, using cpplib.
- Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007,
+ 2008 Free Software Foundation, Inc.
Written by Per Bothner, 1994-95.
This program is free software; you can redistribute it and/or modify it
@@ -177,7 +177,24 @@ scan_translation_unit (cpp_reader *pfile
avoid_paste = false;
print.source = NULL;
print.prev = token;
- cpp_output_token (token, print.outf);
+ if (token->type == CPP_PRAGMA)
+ {
+ const char *space;
+ const char *name;
+
+ maybe_print_line (token->src_loc);
+ fputs ("#pragma ", print.outf);
+ c_pp_lookup_pragma (token->val.pragma, &space, &name);
+ if (space)
+ fprintf (print.outf, "%s %s", space, name);
+ else
+ fprintf (print.outf, "%s", name);
+ print.printed = 1;
+ }
+ else if (token->type == CPP_PRAGMA_EOL)
+ maybe_print_line (token->src_loc);
+ else
+ cpp_output_token (token, print.outf);
if (token->type == CPP_COMMENT)
account_for_newlines (token->val.str.text, token->val.str.len);
--- gcc/c-pragma.c.jj 2007-08-13 15:11:18.000000000 +0200
+++ gcc/c-pragma.c 2008-01-24 11:58:18.000000000 +0100
@@ -1,6 +1,6 @@
/* Handle #pragma, system V.4 style. Supports #pragma weak and #pragma pack.
Copyright (C) 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007 Free Software Foundation, Inc.
+ 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
@@ -871,6 +871,59 @@ DEF_VEC_ALLOC_O (pragma_handler, heap);
static VEC(pragma_handler, heap) *registered_pragmas;
+typedef struct
+{
+ const char *space;
+ const char *name;
+} pragma_ns_name;
+
+DEF_VEC_O (pragma_ns_name);
+DEF_VEC_ALLOC_O (pragma_ns_name, heap);
+
+static VEC(pragma_ns_name, heap) *registered_pp_pragmas;
+
+void
+c_pp_lookup_pragma (unsigned int id, const char **space, const char **name)
+{
+ *space = NULL;
+ *name = NULL;
+ switch (id)
+ {
+ case PRAGMA_OMP_ATOMIC: *name = "atomic"; break;
+ case PRAGMA_OMP_BARRIER: *name = "barrier"; break;
+ case PRAGMA_OMP_CRITICAL: *name = "critical"; break;
+ case PRAGMA_OMP_FLUSH: *name = "flush"; break;
+ case PRAGMA_OMP_FOR: *name = "for"; break;
+ case PRAGMA_OMP_MASTER: *name = "master"; break;
+ case PRAGMA_OMP_ORDERED: *name = "ordered"; break;
+ case PRAGMA_OMP_PARALLEL: *name = "parallel"; break;
+ case PRAGMA_OMP_SECTION: *name = "section"; break;
+ case PRAGMA_OMP_SECTIONS: *name = "sections"; break;
+ case PRAGMA_OMP_SINGLE: *name = "single"; break;
+ case PRAGMA_OMP_THREADPRIVATE: *name = "threadprivate"; break;
+ default: break;
+ }
+
+ if (*name)
+ {
+ *space = "omp";
+ return;
+ }
+
+ if (id >= PRAGMA_FIRST_EXTERNAL
+ && (id < PRAGMA_FIRST_EXTERNAL
+ + VEC_length (pragma_ns_name, registered_pp_pragmas)))
+ {
+ *space = VEC_index (pragma_ns_name, registered_pp_pragmas,
+ id - PRAGMA_FIRST_EXTERNAL)->space;
+ *name = VEC_index (pragma_ns_name, registered_pp_pragmas,
+ id - PRAGMA_FIRST_EXTERNAL)->name;
+ return;
+ }
+
+ gcc_unreachable ();
+}
+
/* Front-end wrappers for pragma registration to avoid dragging
cpplib.h in almost everywhere. */
@@ -880,13 +933,29 @@ c_register_pragma_1 (const char *space,
{
unsigned id;
- VEC_safe_push (pragma_handler, heap, registered_pragmas, &handler);
- id = VEC_length (pragma_handler, registered_pragmas);
- id += PRAGMA_FIRST_EXTERNAL - 1;
-
- /* The C++ front end allocates 6 bits in cp_token; the C front end
- allocates 7 bits in c_token. At present this is sufficient. */
- gcc_assert (id < 64);
+ if (flag_preprocess_only)
+ {
+ pragma_ns_name ns_name;
+
+ if (!allow_expansion)
+ return;
+
+ ns_name.space = space;
+ ns_name.name = name;
+ VEC_safe_push (pragma_ns_name, heap, registered_pp_pragmas, &ns_name);
+ id = VEC_length (pragma_ns_name, registered_pp_pragmas);
+ id += PRAGMA_FIRST_EXTERNAL - 1;
+ }
+ else
+ {
+ VEC_safe_push (pragma_handler, heap, registered_pragmas, &handler);
+ id = VEC_length (pragma_handler, registered_pragmas);
+ id += PRAGMA_FIRST_EXTERNAL - 1;
+
+ /* The C++ front end allocates 6 bits in cp_token; the C front end
+ allocates 7 bits in c_token. At present this is sufficient. */
+ gcc_assert (id < 64);
+ }
cpp_register_deferred_pragma (parse_in, space, name, id,
allow_expansion, false);
@@ -920,7 +989,7 @@ c_invoke_pragma_handler (unsigned int id
void
init_pragma (void)
{
- if (flag_openmp && !flag_preprocess_only)
+ if (flag_openmp)
{
struct omp_pragma_def { const char *name; unsigned int id; };
static const struct omp_pragma_def omp_pragmas[] = {
@@ -946,8 +1015,9 @@ init_pragma (void)
omp_pragmas[i].id, true, true);
}
- cpp_register_deferred_pragma (parse_in, "GCC", "pch_preprocess",
- PRAGMA_GCC_PCH_PREPROCESS, false, false);
+ if (!flag_preprocess_only)
+ cpp_register_deferred_pragma (parse_in, "GCC", "pch_preprocess",
+ PRAGMA_GCC_PCH_PREPROCESS, false, false);
#ifdef HANDLE_PRAGMA_PACK
#ifdef HANDLE_PRAGMA_PACK_WITH_EXPANSION
--- gcc/c-opts.c.jj 2008-01-22 15:12:11.000000000 +0100
+++ gcc/c-opts.c 2008-01-24 11:50:39.000000000 +0100
@@ -1,5 +1,5 @@
/* C/ObjC/C++ command line option handling.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by Neil Booth.
@@ -1238,6 +1238,9 @@ c_common_init (void)
if (version_flag)
c_common_print_pch_checksum (stderr);
+ /* Has to wait until now so that cpplib has its hash table. */
+ init_pragma ();
+
if (flag_preprocess_only)
{
finish_options ();
@@ -1245,9 +1248,6 @@ c_common_init (void)
return false;
}
- /* Has to wait until now so that cpplib has its hash table. */
- init_pragma ();
-
return true;
}
--- gcc/c-pragma.h.jj 2007-09-14 11:54:36.000000000 +0200
+++ gcc/c-pragma.h 2008-01-24 11:50:28.000000000 +0100
@@ -1,6 +1,6 @@
/* Pragma related interfaces.
Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2007 Free Software Foundation, Inc.
+ 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
@@ -124,4 +124,6 @@ extern enum cpp_ttype pragma_lex (tree *
extern enum cpp_ttype c_lex_with_flags (tree *, location_t *, unsigned char *,
int);
+extern void c_pp_lookup_pragma (unsigned int, const char **, const char **);
+
#endif /* GCC_C_PRAGMA_H */
--- gcc/config/darwin.h.jj 2007-10-11 10:54:22.000000000 +0200
+++ gcc/config/darwin.h 2008-01-24 11:48:48.000000000 +0100
@@ -892,8 +892,9 @@ enum machopic_addr_class {
#define DARWIN_REGISTER_TARGET_PRAGMAS() \
do { \
- cpp_register_pragma (parse_in, NULL, "mark", \
- darwin_pragma_ignore, false); \
+ if (!flag_preprocess_only) \
+ cpp_register_pragma (parse_in, NULL, "mark", \
+ darwin_pragma_ignore, false); \
c_register_pragma (0, "options", darwin_pragma_options); \
c_register_pragma (0, "segment", darwin_pragma_ignore); \
c_register_pragma (0, "unused", darwin_pragma_unused); \
--- gcc/testsuite/gcc.dg/gomp/preprocess-1.c.jj 2008-01-24 12:32:02.000000000 +0100
+++ gcc/testsuite/gcc.dg/gomp/preprocess-1.c 2008-01-24 12:35:40.000000000 +0100
@@ -0,0 +1,16 @@
+/* { dg-do preprocess } */
+
+void foo (void)
+{
+ int i1, j1, k1;
+#define p parallel
+#define P(x) private (x##1)
+#define S(x) shared (x##1)
+#define F(x) firstprivate (x##1)
+#pragma omp p P(i) \
+ S(j) \
+ F(k)
+ ;
+}
+
+/* { dg-final { scan-file preprocess-1.i "(^|\n)#pragma omp parallel private \\(i1\\) shared \\(j1\\) firstprivate \\(k1\\)($|\n)" } } */

View File

@ -0,0 +1,17 @@
2008-01-25 Jakub Jelinek <jakub@redhat.com>
* lang.c (java_classify_record): Revert 2007-12-20 change.
--- gcc/java/lang.c 2007-12-27 09:09:49.000000000 +0100
+++ gcc/java/lang.c 2008-01-25 17:43:57.000000000 +0100
@@ -965,9 +965,7 @@ java_classify_record (tree type)
if (! CLASS_P (type))
return RECORD_IS_STRUCT;
- /* ??? GDB does not support DW_TAG_interface_type as of December,
- 2007. Re-enable this at a later time. */
- if (0 && CLASS_INTERFACE (TYPE_NAME (type)))
+ if (CLASS_INTERFACE (TYPE_NAME (type)))
return RECORD_IS_INTERFACE;
return RECORD_IS_CLASS;

View File

@ -1,47 +1,8 @@
2007-06-01 Jakub Jelinek <jakub@redhat.com> 2007-06-01 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/32139 PR tree-optimization/32139
* c-typeck.c (common_pointer_type): Set TYPE_READONLY
and TYPE_VOLATILE on the merged pointed to FUNCTION_TYPE
only if both pointed_to_1 and pointed_to_2 are TYPE_READONLY
resp. TYPE_VOLATILE.
* gcc.c-torture/compile/20070531-1.c: New test. * gcc.c-torture/compile/20070531-1.c: New test.
--- gcc/c-typeck.c.jj 2007-04-25 10:13:52.000000000 +0200
+++ gcc/c-typeck.c 2007-06-01 10:51:53.000000000 +0200
@@ -499,6 +499,7 @@ common_pointer_type (tree t1, tree t2)
tree pointed_to_1, mv1;
tree pointed_to_2, mv2;
tree target;
+ int type_quals;
/* Save time if the two types are the same. */
@@ -526,10 +527,19 @@ common_pointer_type (tree t1, tree t2)
if (TREE_CODE (mv2) != ARRAY_TYPE)
mv2 = TYPE_MAIN_VARIANT (pointed_to_2);
target = composite_type (mv1, mv2);
- t1 = build_pointer_type (c_build_qualified_type
- (target,
- TYPE_QUALS (pointed_to_1) |
- TYPE_QUALS (pointed_to_2)));
+ type_quals = TYPE_QUALS (pointed_to_1) | TYPE_QUALS (pointed_to_2);
+ if (TREE_CODE (pointed_to_1) == FUNCTION_TYPE)
+ {
+ /* TYPE_READONLY and TYPE_VOLATILE on FUNCTION_TYPE should be
+ logically ANDed, not ORed, as if one function is
+ __attribute__((const)) and the other is not, the common type
+ must be conservatively not __attribute__((const))
+ and similarly for __attribute__((noreturn)). */
+ type_quals &= ~(TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE);
+ type_quals |= (TYPE_QUALS (pointed_to_1) & TYPE_QUALS (pointed_to_2))
+ & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE);
+ }
+ t1 = build_pointer_type (c_build_qualified_type (target, type_quals));
return build_type_attribute_variant (t1, attributes);
}
--- gcc/testsuite/gcc.c-torture/compile/20070531-1.c.jj 2007-05-31 13:47:22.000000000 +0200 --- gcc/testsuite/gcc.c-torture/compile/20070531-1.c.jj 2007-05-31 13:47:22.000000000 +0200
+++ gcc/testsuite/gcc.c-torture/compile/20070531-1.c 2007-06-01 10:57:15.000000000 +0200 +++ gcc/testsuite/gcc.c-torture/compile/20070531-1.c 2007-06-01 10:57:15.000000000 +0200
@@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@

135
gcc43-pr34965.patch Normal file
View File

@ -0,0 +1,135 @@
2008-01-25 Jakub Jelinek <jakub@redhat.com>
PR c++/34965
* c-pretty-print.c (pp_c_exclusive_or_expression): Handle
TRUTH_XOR_EXPR.
(pp_c_logical_and_expression): Handle TRUTH_AND_EXPR.
(pp_c_logical_or_expression): Handle TRUTH_OR_EXPR.
(pp_c_expression): Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR
and TRUTH_XOR_EXPR.
* error.c (dump_expr): Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR
and TRUTH_XOR_EXPR.
* gcc.dg/pr34965.c: New test.
* g++.dg/other/error24.C: New test.
--- gcc/c-pretty-print.c.jj 2007-08-28 11:38:37.000000000 +0200
+++ gcc/c-pretty-print.c 2008-01-25 17:41:06.000000000 +0100
@@ -1,5 +1,6 @@
/* Subroutines common to both C and C++ pretty-printers.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
This file is part of GCC.
@@ -1737,10 +1738,14 @@ pp_c_and_expression (c_pretty_printer *p
static void
pp_c_exclusive_or_expression (c_pretty_printer *pp, tree e)
{
- if (TREE_CODE (e) == BIT_XOR_EXPR)
+ if (TREE_CODE (e) == BIT_XOR_EXPR
+ || TREE_CODE (e) == TRUTH_XOR_EXPR)
{
pp_c_exclusive_or_expression (pp, TREE_OPERAND (e, 0));
- pp_c_maybe_whitespace (pp);
+ if (TREE_CODE (e) == BIT_XOR_EXPR)
+ pp_c_maybe_whitespace (pp);
+ else
+ pp_c_whitespace (pp);
pp_carret (pp);
pp_c_whitespace (pp);
pp_c_and_expression (pp, TREE_OPERAND (e, 1));
@@ -1775,7 +1780,8 @@ pp_c_inclusive_or_expression (c_pretty_p
static void
pp_c_logical_and_expression (c_pretty_printer *pp, tree e)
{
- if (TREE_CODE (e) == TRUTH_ANDIF_EXPR)
+ if (TREE_CODE (e) == TRUTH_ANDIF_EXPR
+ || TREE_CODE (e) == TRUTH_AND_EXPR)
{
pp_c_logical_and_expression (pp, TREE_OPERAND (e, 0));
pp_c_whitespace (pp);
@@ -1794,7 +1800,8 @@ pp_c_logical_and_expression (c_pretty_pr
void
pp_c_logical_or_expression (c_pretty_printer *pp, tree e)
{
- if (TREE_CODE (e) == TRUTH_ORIF_EXPR)
+ if (TREE_CODE (e) == TRUTH_ORIF_EXPR
+ || TREE_CODE (e) == TRUTH_OR_EXPR)
{
pp_c_logical_or_expression (pp, TREE_OPERAND (e, 0));
pp_c_whitespace (pp);
@@ -1963,6 +1970,7 @@ pp_c_expression (c_pretty_printer *pp, t
break;
case BIT_XOR_EXPR:
+ case TRUTH_XOR_EXPR:
pp_c_exclusive_or_expression (pp, e);
break;
@@ -1971,10 +1979,12 @@ pp_c_expression (c_pretty_printer *pp, t
break;
case TRUTH_ANDIF_EXPR:
+ case TRUTH_AND_EXPR:
pp_c_logical_and_expression (pp, e);
break;
case TRUTH_ORIF_EXPR:
+ case TRUTH_OR_EXPR:
pp_c_logical_or_expression (pp, e);
break;
--- gcc/cp/error.c.jj 2008-01-22 15:19:30.000000000 +0100
+++ gcc/cp/error.c 2008-01-25 18:20:30.000000000 +0100
@@ -2083,6 +2083,16 @@ dump_expr (tree t, int flags)
pp_expression (cxx_pp, t);
break;
+ case TRUTH_AND_EXPR:
+ case TRUTH_OR_EXPR:
+ case TRUTH_XOR_EXPR:
+ if (flags & TFF_EXPR_IN_PARENS)
+ pp_cxx_left_paren (cxx_pp);
+ pp_expression (cxx_pp, t);
+ if (flags & TFF_EXPR_IN_PARENS)
+ pp_cxx_right_paren (cxx_pp);
+ break;
+
case OBJ_TYPE_REF:
dump_expr (resolve_virtual_fun_from_obj_type_ref (t), flags);
break;
--- gcc/testsuite/gcc.dg/pr34965.c.jj 2008-01-25 18:25:46.000000000 +0100
+++ gcc/testsuite/gcc.dg/pr34965.c 2008-01-25 18:26:05.000000000 +0100
@@ -0,0 +1,13 @@
+/* PR c++/34965 */
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+int foo (int);
+
+void
+bar (int i, int j, double k)
+{
+ foo (i && j) (); /* { dg-error "\\(i != 0 \\&\\& j != 0\\)" } */
+ foo (!i || !j) (); /* { dg-error "\\(i == 0 \\|\\| j == 0\\)" } */
+ foo (!i == !j) (); /* { dg-error "\\(i != 0 \\^ j == 0\\)" } */
+}
--- gcc/testsuite/g++.dg/other/error24.C.jj 2008-01-25 14:38:12.000000000 +0100
+++ gcc/testsuite/g++.dg/other/error24.C 2008-01-25 18:25:01.000000000 +0100
@@ -0,0 +1,13 @@
+// PR c++/34965
+// { dg-do compile }
+// { dg-options "-O" }
+
+int foo (int);
+
+void
+bar (int i, int j, double k)
+{
+ foo (i && j) (); // { dg-error "\\(i != 0 \\&\\& j != 0\\)" }
+ foo (!i || !j) (); // { dg-error "\\(i == 0 \\|\\| j == 0\\)" }
+ foo (!i == !j) (); // { dg-error "\\(i != 0 \\^ j == 0\\)" }
+}

View File

@ -140,6 +140,7 @@ Patch10: gcc43-rh330771.patch
Patch11: gcc43-rh341221.patch Patch11: gcc43-rh341221.patch
Patch12: gcc43-cpp-pragma.patch Patch12: gcc43-cpp-pragma.patch
Patch13: gcc43-java-debug-iface-type.patch Patch13: gcc43-java-debug-iface-type.patch
Patch14: gcc43-pr34965.patch
# On ARM EABI systems, we do want -gnueabi to be part of the # On ARM EABI systems, we do want -gnueabi to be part of the
# target triple. # target triple.
@ -434,8 +435,9 @@ which are required to run programs compiled with the GNAT.
%patch9 -p0 -b .pr33763~ %patch9 -p0 -b .pr33763~
%patch10 -p0 -b .rh330771~ %patch10 -p0 -b .rh330771~
%patch11 -p0 -b .rh341221~ %patch11 -p0 -b .rh341221~
%patch12 -p0 -b .cpp-pragma.patch %patch12 -p0 -b .cpp-pragma~
%patch13 -p0 -b .java-debug-iface-type %patch13 -p0 -b .java-debug-iface-type~
%patch14 -p0 -b .pr34965~
tar xzf %{SOURCE4} tar xzf %{SOURCE4}

View File

@ -1,2 +1,2 @@
7c36a96cc44b241ec68e4b287a2abd68 gcc-4.3.0-20080110.tar.bz2 011827ce044badacd7265f6abd8a473d gcc-4.3.0-20080125.tar.bz2
92a70f9e56223b653bce0f58f90cf950 fastjar-0.95.tar.gz 92a70f9e56223b653bce0f58f90cf950 fastjar-0.95.tar.gz