rpms/gcc/F-7 gcc41-artificial-attrib.patch, NONE, 1.1 gcc41-error-attrib.patch, NONE, 1.1 gcc41-jdwp.patch, NONE, 1.1 gcc41-pr20880.patch, NONE, 1.1 gcc41-pr32694.patch, NONE, 1.1 gcc41-pr33506.patch, NONE, 1.1 .cvsignore, 1.207, 1.208 gcc41.spec, 1.166, 1.167 sources, 1.209, 1.210 gcc41-builtin-chk-anticipated.patch, 1.1, NONE gcc41-builtin-throw.patch, 1.1, NONE gcc41-builtin-va-arg-pack-len.patch, 1.1, NONE gcc41-builtin-va-arg-pack.patch, 1.2, NONE gcc41-c++-gnu_inline.patch, 1.1, NONE gcc41-ppc-sync-qihi.patch, 1.1, NONE gcc41-ppc-tramp.patch, 1.1, NONE gcc41-pr22244.patch, 1.1, NONE gcc41-pr27954.patch, 1.1, NONE gcc41-pr32678.patch, 1.1, NONE gcc41-pr32912.patch, 1.1, NONE gcc41-pr33423.patch, 1.1, NONE gcc41-rh253102.patch, 1.1, NONE gcc41-scanf-fmt-check.patch, 1.1, NONE gcc41-sparc-niagara.patch, 1.1, NONE
Jakub Jelinek (jakub)
fedora-extras-commits at redhat.com
Tue Sep 25 23:17:44 UTC 2007
- Previous message (by thread): rpms/eclipse-demos/devel .cvsignore, NONE, 1.1 Makefile, NONE, 1.1 sources, NONE, 1.1
- Next message (by thread): rpms/gwget/devel gwget-0.99-epiphany.patch, NONE, 1.1 gwget.spec, 1.22, 1.23 gwget-0.99-epiphany220.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: jakub
Update of /cvs/pkgs/rpms/gcc/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv28547
Modified Files:
.cvsignore gcc41.spec sources
Added Files:
gcc41-artificial-attrib.patch gcc41-error-attrib.patch
gcc41-jdwp.patch gcc41-pr20880.patch gcc41-pr32694.patch
gcc41-pr33506.patch
Removed Files:
gcc41-builtin-chk-anticipated.patch gcc41-builtin-throw.patch
gcc41-builtin-va-arg-pack-len.patch
gcc41-builtin-va-arg-pack.patch gcc41-c++-gnu_inline.patch
gcc41-ppc-sync-qihi.patch gcc41-ppc-tramp.patch
gcc41-pr22244.patch gcc41-pr27954.patch gcc41-pr32678.patch
gcc41-pr32912.patch gcc41-pr33423.patch gcc41-rh253102.patch
gcc41-scanf-fmt-check.patch gcc41-sparc-niagara.patch
Log Message:
4.1.2-27.fc7
gcc41-artificial-attrib.patch:
--- NEW FILE gcc41-artificial-attrib.patch ---
2007-09-23 Jakub Jelinek <jakub at redhat.com>
* tree.h (block_nonartificial_location): New prototype.
* tree.c (block_nonartificial_location): New function.
* dwarf2out.c (gen_subprogram_die): Add DW_AT_artificial
if artificial attribute is present on abstract inline decl.
* c-common.c (handle_artificial_attribute): New function.
(c_common_attribute_table): Add artificial attribute.
* final.c (override_filename, override_linenum): New variables.
(final_scan_insn): For DBX_DEBUG or SDB_DEBUG, set override_filename
and override_linenum if inside of a block inlined from
__attribute__((__artificial__)) function.
(notice_source_line): Honor override_filename and override_linenum.
* doc/extend.texi: Document __attribute__((__artificial__)).
* config/i386/emmintrin.h: Add __artificial__ attribute to
all __always_inline__ functions.
* config/i386/mmintrin.h: Likewise.
* config/i386/mm3dnow.h: Likewise.
* config/i386/pmmintrin.h: Likewise.
* config/i386/ammintrin.h: Likewise.
* config/i386/xmmintrin.h: Likewise.
--- gcc/doc/extend.texi.jj 2007-09-25 12:23:05.000000000 +0200
+++ gcc/doc/extend.texi 2007-09-25 15:04:15.000000000 +0200
@@ -1589,7 +1589,8 @@ attributes are currently defined for fun
@code{section}, @code{constructor}, @code{destructor}, @code{used},
@code{unused}, @code{deprecated}, @code{weak}, @code{malloc},
@code{alias}, @code{warn_unused_result}, @code{nonnull},
- at code{gnu_inline} and @code{externally_visible}. Several other
+ at code{gnu_inline}, @code{externally_visible} and @code{artificial}.
+Several other
attributes are defined for functions on particular target systems. Other
attributes, including @code{section} are supported for variables declarations
(@pxref{Variable Attributes}) and for types (@pxref{Type Attributes}).
@@ -1671,6 +1672,14 @@ In C++, this attribute does not depend o
but it still requires the @code{inline} keyword to enable its special
behavior.
+ at cindex @code{artificial} function attribute
+ at item artificial
+This attribute is useful for small inline wrappers which if possible
+should appear during debugging as a unit, depending on the debug
+info format it will either mean marking the function as artificial
+or using the caller location for all instructions within the inlined
+body.
+
@cindex @code{flatten} function attribute
@item flatten
Generally, inlining into a function is limited. For a function marked with
--- gcc/tree.c.jj 2007-04-03 13:18:26.000000000 +0200
+++ gcc/tree.c 2007-09-25 15:01:49.000000000 +0200
@@ -7638,4 +7638,40 @@ empty_body_p (tree stmt)
return true;
}
+/* If BLOCK is inlined from an __attribute__((__artificial__))
+ routine, return pointer to location from where it has been
+ called. */
+location_t *
+block_nonartificial_location (tree block)
+{
+ location_t *ret = NULL;
+
+ while (block && TREE_CODE (block) == BLOCK
+ && BLOCK_ABSTRACT_ORIGIN (block))
+ {
+ tree ao = BLOCK_ABSTRACT_ORIGIN (block);
+
+ while (TREE_CODE (ao) == BLOCK && BLOCK_ABSTRACT_ORIGIN (ao))
+ ao = BLOCK_ABSTRACT_ORIGIN (ao);
+
+ if (TREE_CODE (ao) == FUNCTION_DECL)
+ {
+ /* If AO is an artificial inline, point RET to the
+ call site locus at which it has been inlined and continue
+ the loop, in case AO's caller is also an artificial
+ inline. */
+ if (DECL_DECLARED_INLINE_P (ao)
+ && lookup_attribute ("artificial", DECL_ATTRIBUTES (ao)))
+ ret = &BLOCK_SOURCE_LOCATION (block);
+ else
+ break;
+ }
+ else if (TREE_CODE (ao) != BLOCK)
+ break;
+
+ block = BLOCK_SUPERCONTEXT (block);
+ }
+ return ret;
+}
+
#include "gt-tree.h"
--- gcc/tree.h.jj 2007-09-25 12:20:12.000000000 +0200
+++ gcc/tree.h 2007-09-25 15:02:37.000000000 +0200
@@ -4270,6 +4270,8 @@ extern tree build_addr (tree, tree);
extern bool fields_compatible_p (tree, tree);
extern tree find_compatible_field (tree, tree);
+extern location_t *block_nonartificial_location (tree);
+
/* In function.c */
extern void expand_main_function (void);
extern void init_dummy_function_start (void);
--- gcc/final.c.jj 2007-02-20 22:39:12.000000000 +0100
+++ gcc/final.c 2007-09-25 15:01:49.000000000 +0200
@@ -141,6 +141,10 @@ static int high_function_linenum;
/* Filename of last NOTE. */
static const char *last_filename;
+/* Override filename and line number. */
+static const char *override_filename;
+static int override_linenum;
+
/* Whether to force emission of a line note before the next insn. */
static bool force_source_line = false;
@@ -1822,6 +1826,18 @@ final_scan_insn (rtx insn, FILE *file, i
/* Mark this block as output. */
TREE_ASM_WRITTEN (NOTE_BLOCK (insn)) = 1;
}
+ if (write_symbols == DBX_DEBUG
+ || write_symbols == SDB_DEBUG)
+ {
+ location_t *locus_ptr
+ = block_nonartificial_location (NOTE_BLOCK (insn));
+
+ if (locus_ptr != NULL)
+ {
+ override_filename = LOCATION_FILE (*locus_ptr);
+ override_linenum = LOCATION_LINE (*locus_ptr);
+ }
+ }
break;
case NOTE_INSN_BLOCK_END:
@@ -1841,6 +1857,24 @@ final_scan_insn (rtx insn, FILE *file, i
(*debug_hooks->end_block) (high_block_linenum, n);
}
+ if (write_symbols == DBX_DEBUG
+ || write_symbols == SDB_DEBUG)
+ {
+ tree outer_block = BLOCK_SUPERCONTEXT (NOTE_BLOCK (insn));
+ location_t *locus_ptr
+ = block_nonartificial_location (outer_block);
+
+ if (locus_ptr != NULL)
+ {
+ override_filename = LOCATION_FILE (*locus_ptr);
+ override_linenum = LOCATION_LINE (*locus_ptr);
+ }
+ else
+ {
+ override_filename = NULL;
+ override_linenum = 0;
+ }
+ }
break;
case NOTE_INSN_DELETED_LABEL:
@@ -2521,8 +2555,19 @@ final_scan_insn (rtx insn, FILE *file, i
static bool
notice_source_line (rtx insn)
{
- const char *filename = insn_file (insn);
- int linenum = insn_line (insn);
+ const char *filename;
+ int linenum;
+
+ if (override_filename)
+ {
+ filename = override_filename;
+ linenum = override_linenum;
+ }
+ else
+ {
+ filename = insn_file (insn);
+ linenum = insn_line (insn);
+ }
if (filename
&& (force_source_line
--- gcc/dwarf2out.c.jj 2007-04-03 13:13:27.000000000 +0200
+++ gcc/dwarf2out.c 2007-09-25 15:01:49.000000000 +0200
@@ -11667,6 +11667,10 @@ gen_subprogram_die (tree decl, dw_die_re
add_AT_unsigned (subr_die, DW_AT_inline, DW_INL_not_inlined);
}
+ if (DECL_DECLARED_INLINE_P (decl)
+ && lookup_attribute ("artificial", DECL_ATTRIBUTES (decl)))
+ add_AT_flag (subr_die, DW_AT_artificial, 1);
+
equate_decl_number_to_die (decl, subr_die);
}
else if (!DECL_EXTERNAL (decl))
--- gcc/c-common.c.jj 2007-03-27 15:40:15.000000000 +0200
+++ gcc/c-common.c 2007-09-25 15:01:49.000000000 +0200
@@ -505,8 +505,8 @@ static tree handle_noreturn_attribute (t
static tree handle_noinline_attribute (tree *, tree, tree, int, bool *);
[...3799 lines suppressed...]
return (__m128i)__builtin_ia32_pcmpgtd128 ((__v4si)__A, (__v4si)__B);
}
#if 0
-static __inline int __attribute__((__always_inline__))
+static __inline int __attribute__((__always_inline__, __artificial__))
_mm_extract_epi16 (__m128i const __A, int const __N)
{
return __builtin_ia32_vec_ext_v8hi ((__v8hi)__A, __N);
}
-static __inline __m128i __attribute__((__always_inline__))
+static __inline __m128i __attribute__((__always_inline__, __artificial__))
_mm_insert_epi16 (__m128i const __A, int const __D, int const __N)
{
return (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)__A, __D, __N);
@@ -1341,37 +1341,37 @@ _mm_insert_epi16 (__m128i const __A, int
((__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)(A), (D), (N)))
#endif
-static __inline __m128i __attribute__((__always_inline__))
+static __inline __m128i __attribute__((__always_inline__, __artificial__))
_mm_max_epi16 (__m128i __A, __m128i __B)
{
return (__m128i)__builtin_ia32_pmaxsw128 ((__v8hi)__A, (__v8hi)__B);
}
-static __inline __m128i __attribute__((__always_inline__))
+static __inline __m128i __attribute__((__always_inline__, __artificial__))
_mm_max_epu8 (__m128i __A, __m128i __B)
{
return (__m128i)__builtin_ia32_pmaxub128 ((__v16qi)__A, (__v16qi)__B);
}
-static __inline __m128i __attribute__((__always_inline__))
+static __inline __m128i __attribute__((__always_inline__, __artificial__))
_mm_min_epi16 (__m128i __A, __m128i __B)
{
return (__m128i)__builtin_ia32_pminsw128 ((__v8hi)__A, (__v8hi)__B);
}
-static __inline __m128i __attribute__((__always_inline__))
+static __inline __m128i __attribute__((__always_inline__, __artificial__))
_mm_min_epu8 (__m128i __A, __m128i __B)
{
return (__m128i)__builtin_ia32_pminub128 ((__v16qi)__A, (__v16qi)__B);
}
-static __inline int __attribute__((__always_inline__))
+static __inline int __attribute__((__always_inline__, __artificial__))
_mm_movemask_epi8 (__m128i __A)
{
return __builtin_ia32_pmovmskb128 ((__v16qi)__A);
}
-static __inline __m128i __attribute__((__always_inline__))
+static __inline __m128i __attribute__((__always_inline__, __artificial__))
_mm_mulhi_epu16 (__m128i __A, __m128i __B)
{
return (__m128i)__builtin_ia32_pmulhuw128 ((__v8hi)__A, (__v8hi)__B);
@@ -1381,67 +1381,67 @@ _mm_mulhi_epu16 (__m128i __A, __m128i __
#define _mm_shufflelo_epi16(__A, __B) ((__m128i)__builtin_ia32_pshuflw ((__v8hi)__A, __B))
#define _mm_shuffle_epi32(__A, __B) ((__m128i)__builtin_ia32_pshufd ((__v4si)__A, __B))
-static __inline void __attribute__((__always_inline__))
+static __inline void __attribute__((__always_inline__, __artificial__))
_mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C)
{
__builtin_ia32_maskmovdqu ((__v16qi)__A, (__v16qi)__B, __C);
}
-static __inline __m128i __attribute__((__always_inline__))
+static __inline __m128i __attribute__((__always_inline__, __artificial__))
_mm_avg_epu8 (__m128i __A, __m128i __B)
{
return (__m128i)__builtin_ia32_pavgb128 ((__v16qi)__A, (__v16qi)__B);
}
-static __inline __m128i __attribute__((__always_inline__))
+static __inline __m128i __attribute__((__always_inline__, __artificial__))
_mm_avg_epu16 (__m128i __A, __m128i __B)
{
return (__m128i)__builtin_ia32_pavgw128 ((__v8hi)__A, (__v8hi)__B);
}
-static __inline __m128i __attribute__((__always_inline__))
+static __inline __m128i __attribute__((__always_inline__, __artificial__))
_mm_sad_epu8 (__m128i __A, __m128i __B)
{
return (__m128i)__builtin_ia32_psadbw128 ((__v16qi)__A, (__v16qi)__B);
}
-static __inline void __attribute__((__always_inline__))
+static __inline void __attribute__((__always_inline__, __artificial__))
_mm_stream_si32 (int *__A, int __B)
{
__builtin_ia32_movnti (__A, __B);
}
-static __inline void __attribute__((__always_inline__))
+static __inline void __attribute__((__always_inline__, __artificial__))
_mm_stream_si128 (__m128i *__A, __m128i __B)
{
__builtin_ia32_movntdq ((__v2di *)__A, (__v2di)__B);
}
-static __inline void __attribute__((__always_inline__))
+static __inline void __attribute__((__always_inline__, __artificial__))
_mm_stream_pd (double *__A, __m128d __B)
{
__builtin_ia32_movntpd (__A, (__v2df)__B);
}
-static __inline void __attribute__((__always_inline__))
+static __inline void __attribute__((__always_inline__, __artificial__))
_mm_clflush (void const *__A)
{
__builtin_ia32_clflush (__A);
}
-static __inline void __attribute__((__always_inline__))
+static __inline void __attribute__((__always_inline__, __artificial__))
_mm_lfence (void)
{
__builtin_ia32_lfence ();
}
-static __inline void __attribute__((__always_inline__))
+static __inline void __attribute__((__always_inline__, __artificial__))
_mm_mfence (void)
{
__builtin_ia32_mfence ();
}
-static __inline __m128i __attribute__((__always_inline__))
+static __inline __m128i __attribute__((__always_inline__, __artificial__))
_mm_cvtsi32_si128 (int __A)
{
return _mm_set_epi32 (0, 0, 0, __A);
@@ -1449,14 +1449,14 @@ _mm_cvtsi32_si128 (int __A)
#ifdef __x86_64__
/* Intel intrinsic. */
-static __inline __m128i __attribute__((__always_inline__))
+static __inline __m128i __attribute__((__always_inline__, __artificial__))
_mm_cvtsi64_si128 (long long __A)
{
return _mm_set_epi64x (0, __A);
}
/* Microsoft intrinsic. */
-static __inline __m128i __attribute__((__always_inline__))
+static __inline __m128i __attribute__((__always_inline__, __artificial__))
_mm_cvtsi64x_si128 (long long __A)
{
return _mm_set_epi64x (0, __A);
@@ -1465,37 +1465,37 @@ _mm_cvtsi64x_si128 (long long __A)
/* Casts between various SP, DP, INT vector types. Note that these do no
conversion of values, they just change the type. */
-static __inline __m128 __attribute__((__always_inline__))
+static __inline __m128 __attribute__((__always_inline__, __artificial__))
_mm_castpd_ps(__m128d __A)
{
return (__m128) __A;
}
-static __inline __m128i __attribute__((__always_inline__))
+static __inline __m128i __attribute__((__always_inline__, __artificial__))
_mm_castpd_si128(__m128d __A)
{
return (__m128i) __A;
}
-static __inline __m128d __attribute__((__always_inline__))
+static __inline __m128d __attribute__((__always_inline__, __artificial__))
_mm_castps_pd(__m128 __A)
{
return (__m128d) __A;
}
-static __inline __m128i __attribute__((__always_inline__))
+static __inline __m128i __attribute__((__always_inline__, __artificial__))
_mm_castps_si128(__m128 __A)
{
return (__m128i) __A;
}
-static __inline __m128 __attribute__((__always_inline__))
+static __inline __m128 __attribute__((__always_inline__, __artificial__))
_mm_castsi128_ps(__m128i __A)
{
return (__m128) __A;
}
-static __inline __m128d __attribute__((__always_inline__))
+static __inline __m128d __attribute__((__always_inline__, __artificial__))
_mm_castsi128_pd(__m128i __A)
{
return (__m128d) __A;
gcc41-error-attrib.patch:
--- NEW FILE gcc41-error-attrib.patch ---
2007-09-23 Jakub Jelinek <jakub at redhat.com>
* expr.c (expand_expr_real_1) <case CALL_EXPR>: Use get_callee_fndecl
instead of checking CALL_EXPR_FN directly to test for builtins.
If error or warning attributes are present, print
error resp. warning.
* c-common.c (handle_error_attribute): New function.
(c_common_attribute_table): Add error and warning
attributes.
* doc/extend.texi: Document error and warning attributes.
* gcc.dg/va-arg-pack-len-1.c: Use error and warning
attributes.
* gcc.dg/va-arg-pack-len-2.c: New test.
* g++.dg/ext/va-arg-pack-len-1.C: Use error and warning
attributes.
* g++.dg/ext/va-arg-pack-len-2.C: New test.
--- gcc/doc/extend.texi.jj 2007-09-25 15:04:15.000000000 +0200
+++ gcc/doc/extend.texi 2007-09-25 15:32:22.000000000 +0200
@@ -1589,8 +1589,8 @@ attributes are currently defined for fun
@code{section}, @code{constructor}, @code{destructor}, @code{used},
@code{unused}, @code{deprecated}, @code{weak}, @code{malloc},
@code{alias}, @code{warn_unused_result}, @code{nonnull},
- at code{gnu_inline}, @code{externally_visible} and @code{artificial}.
-Several other
+ at code{gnu_inline}, @code{externally_visible}, @code{artificial},
+ at code{error} and @code{warning}. Several other
attributes are defined for functions on particular target systems. Other
attributes, including @code{section} are supported for variables declarations
(@pxref{Variable Attributes}) and for types (@pxref{Type Attributes}).
@@ -1688,6 +1688,30 @@ Whether the function itself is considere
the current inlining parameters. The @code{flatten} attribute only works
reliably in unit-at-a-time mode.
+ at item error ("@var{message}")
+ at cindex @code{error} function attribute
+If this attribute is used on a function declaration and a call to such a function
+is not eliminated through dead code elimination or other optimizations, an error
+which will include @var{message} will be diagnosed. This is useful
+for compile time checking, especially together with @code{__builtin_constant_p}
+and inline functions where checking the inline function arguments is not
+possible through @code{extern char [(condition) ? 1 : -1];} tricks.
+While it is possible to leave the function undefined and thus invoke
+a link failure, when using this attribute the problem will be diagnosed
+earlier and with exact location of the call even in presence of inline
+functions or when not emitting debugging information.
+
+ at item warning ("@var{message}")
+ at cindex @code{warning} function attribute
+If this attribute is used on a function declaration and a call to such a function
+is not eliminated through dead code elimination or other optimizations, a warning
+which will include @var{message} will be diagnosed. This is useful
+for compile time checking, especially together with @code{__builtin_constant_p}
+and inline functions. While it is possible to define the function with
+a message in @code{.gnu.warning*} section, when using this attribute the problem
+will be diagnosed earlier and with exact location of the call even in presence
+of inline functions or when not emitting debugging information.
+
@item cdecl
@cindex functions that do pop the argument stack on the 386
@opindex mrtd
--- gcc/expr.c.jj 2007-09-25 14:58:40.000000000 +0200
+++ gcc/expr.c 2007-09-25 15:19:15.000000000 +0200
@@ -7513,19 +7513,31 @@ expand_expr_real_1 (tree exp, rtx target
inlining. */
if (CALL_EXPR_VA_ARG_PACK (exp))
error ("invalid use of %<__builtin_va_arg_pack ()%>");
- /* Check for a built-in function. */
- if (TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR
- && (TREE_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))
- == FUNCTION_DECL)
- && DECL_BUILT_IN (TREE_OPERAND (TREE_OPERAND (exp, 0), 0)))
- {
- if (DECL_BUILT_IN_CLASS (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))
- == BUILT_IN_FRONTEND)
- return lang_hooks.expand_expr (exp, original_target,
- tmode, modifier,
- alt_rtl);
- else
- return expand_builtin (exp, target, subtarget, tmode, ignore);
+ {
+ tree fndecl = get_callee_fndecl (exp), attr;
+
+ if (fndecl
+ && (attr = lookup_attribute ("error",
+ DECL_ATTRIBUTES (fndecl))) != NULL)
+ error ("call to %qs declared with attribute error: %s",
+ lang_hooks.decl_printable_name (fndecl, 1),
+ TREE_STRING_POINTER (TREE_VALUE (TREE_VALUE (attr))));
+ if (fndecl
+ && (attr = lookup_attribute ("warning",
+ DECL_ATTRIBUTES (fndecl))) != NULL)
+ warning (0, "call to %qs declared with attribute warning: %s",
+ lang_hooks.decl_printable_name (fndecl, 1),
+ TREE_STRING_POINTER (TREE_VALUE (TREE_VALUE (attr))));
+
+ /* Check for a built-in function. */
+ if (fndecl && DECL_BUILT_IN (fndecl))
+ {
+ if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_FRONTEND)
+ return lang_hooks.expand_expr (exp, original_target,
+ tmode, modifier, alt_rtl);
+ else
+ return expand_builtin (exp, target, subtarget, tmode, ignore);
+ }
}
return expand_call (exp, target, ignore);
--- gcc/c-common.c.jj 2007-09-25 15:01:49.000000000 +0200
+++ gcc/c-common.c 2007-09-25 15:24:34.000000000 +0200
@@ -508,6 +508,7 @@ static tree handle_always_inline_attribu
static tree handle_gnu_inline_attribute (tree *, tree, tree, int, bool *);
static tree handle_artificial_attribute (tree *, tree, tree, int, bool *);
static tree handle_flatten_attribute (tree *, tree, tree, int, bool *);
+static tree handle_error_attribute (tree *, tree, tree, int, bool *);
static tree handle_used_attribute (tree *, tree, tree, int, bool *);
static tree handle_unused_attribute (tree *, tree, tree, int, bool *);
static tree handle_externally_visible_attribute (tree *, tree, tree, int,
@@ -641,6 +642,10 @@ const struct attribute_spec c_common_att
handle_warn_unused_result_attribute },
{ "sentinel", 0, 1, false, true, true,
handle_sentinel_attribute },
+ { "warning", 1, 1, true, false, false,
+ handle_error_attribute },
+ { "error", 1, 1, true, false, false,
+ handle_error_attribute },
{ NULL, 0, 0, false, false, false, NULL }
};
@@ -4226,6 +4231,26 @@ handle_flatten_attribute (tree *node, tr
return NULL_TREE;
}
+/* Handle a "warning" or "error" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+static tree
+handle_error_attribute (tree *node, tree name, tree args,
+ int ARG_UNUSED (flags), bool *no_add_attrs)
+{
+ if (TREE_CODE (*node) == FUNCTION_DECL
+ || TREE_CODE (TREE_VALUE (args)) == STRING_CST)
+ /* Do nothing else, just set the attribute. We'll get at
+ it later with lookup_attribute. */
+ ;
+ else
+ {
+ warning (OPT_Wattributes, "%qE attribute ignored", name);
+ *no_add_attrs = true;
+ }
+
+ return NULL_TREE;
+}
/* Handle a "used" attribute; arguments as in
struct attribute_spec.handler. */
--- gcc/testsuite/gcc.dg/va-arg-pack-len-1.c.jj 2007-09-25 12:23:05.000000000 +0200
+++ gcc/testsuite/gcc.dg/va-arg-pack-len-1.c 2007-09-25 15:16:03.000000000 +0200
@@ -3,8 +3,10 @@
#include <stdarg.h>
-extern int warn_open_missing_mode (void);
-extern int warn_open_too_many_arguments (void);
+extern int error_open_missing_mode (void)
+ __attribute__((__error__ ("open with O_CREAT needs 3 arguments, only 2 were given")));
+extern int warn_open_too_many_arguments (void)
+ __attribute__((__warning__ ("open called with more than 3 arguments")));
extern void abort (void);
char expected_char;
@@ -83,7 +85,7 @@ myopen (const char *path, int oflag, ...
{
if ((oflag & 0x40) != 0 && __builtin_va_arg_pack_len () < 1)
{
- warn_open_missing_mode ();
+ error_open_missing_mode ();
return myopen2 (path, oflag);
}
return myopenva (path, oflag, __builtin_va_arg_pack ());
--- gcc/testsuite/gcc.dg/va-arg-pack-len-2.c.jj 2007-09-25 15:16:03.000000000 +0200
+++ gcc/testsuite/gcc.dg/va-arg-pack-len-2.c 2007-09-25 15:16:03.000000000 +0200
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#include <stdarg.h>
+
+extern int error_open_missing_mode (void)
+ __attribute__((__error__ ("open with O_CREAT needs 3 arguments, only 2 were given")));
+extern int warn_open_too_many_arguments (void)
+ __attribute__((__warning__ ("open called with more than 3 arguments")));
+
+extern int myopen2 (const char *path, int oflag);
+extern int myopenva (const char *path, int oflag, ...);
+
+extern inline __attribute__((always_inline, gnu_inline)) int
+myopen (const char *path, int oflag, ...)
+{
+ if (__builtin_va_arg_pack_len () > 1)
+ warn_open_too_many_arguments (); /* { dg-warning "called with more than 3" } */
+
+ if (__builtin_constant_p (oflag))
+ {
+ if ((oflag & 0x40) != 0 && __builtin_va_arg_pack_len () < 1)
+ {
+ error_open_missing_mode (); /* { dg-error "needs 3 arguments, only 2 were given" } */
+ return myopen2 (path, oflag);
+ }
+ return myopenva (path, oflag, __builtin_va_arg_pack ());
+ }
+
+ if (__builtin_va_arg_pack_len () < 1)
+ return myopen2 (path, oflag);
+
+ return myopenva (path, oflag, __builtin_va_arg_pack ());
+}
+
+int
+main (void)
+{
+ myopen ("h", 0x43);
+ myopen ("i", 0x43, 0644, 0655);
+ return 0;
+}
--- gcc/testsuite/g++.dg/ext/va-arg-pack-len-1.C.jj 2007-09-25 12:23:05.000000000 +0200
+++ gcc/testsuite/g++.dg/ext/va-arg-pack-len-1.C 2007-09-25 15:16:03.000000000 +0200
@@ -3,8 +3,10 @@
#include <stdarg.h>
-extern "C" int warn_open_missing_mode (void);
-extern "C" int warn_open_too_many_arguments (void);
+extern "C" int error_open_missing_mode (void)
+ __attribute__((__error__ ("open with O_CREAT needs 3 arguments, only 2 were given")));
+extern "C" int warn_open_too_many_arguments (void)
+ __attribute__((__warning__ ("open called with more than 3 arguments")));
extern "C" void abort (void);
char expected_char;
@@ -83,7 +85,7 @@ myopen (const char *path, int oflag, ...
{
if ((oflag & 0x40) != 0 && __builtin_va_arg_pack_len () < 1)
{
- warn_open_missing_mode ();
+ error_open_missing_mode ();
return myopen2 (path, oflag);
}
return myopenva (path, oflag, __builtin_va_arg_pack ());
--- gcc/testsuite/g++.dg/ext/va-arg-pack-len-2.C.jj 2007-09-25 15:16:03.000000000 +0200
+++ gcc/testsuite/g++.dg/ext/va-arg-pack-len-2.C 2007-09-25 15:16:03.000000000 +0200
@@ -0,0 +1,42 @@
+// { dg-do compile }
+// { dg-options "-O2" }
+
+#include <stdarg.h>
+
+extern int error_open_missing_mode (void)
+ __attribute__((__error__ ("open with O_CREAT needs 3 arguments, only 2 were given")));
+extern int warn_open_too_many_arguments (void)
+ __attribute__((__warning__ ("open called with more than 3 arguments")));
+
+extern int myopen2 (const char *path, int oflag);
+extern int myopenva (const char *path, int oflag, ...);
+
+extern inline __attribute__((always_inline, gnu_inline)) int
+myopen (const char *path, int oflag, ...)
+{
+ if (__builtin_va_arg_pack_len () > 1)
+ warn_open_too_many_arguments (); // { dg-warning "called with more than 3" }
+
+ if (__builtin_constant_p (oflag))
+ {
+ if ((oflag & 0x40) != 0 && __builtin_va_arg_pack_len () < 1)
+ {
+ error_open_missing_mode (); // { dg-error "needs 3 arguments, only 2 were given" }
+ return myopen2 (path, oflag);
+ }
+ return myopenva (path, oflag, __builtin_va_arg_pack ());
+ }
+
+ if (__builtin_va_arg_pack_len () < 1)
+ return myopen2 (path, oflag);
+
+ return myopenva (path, oflag, __builtin_va_arg_pack ());
+}
+
+int
+main (void)
+{
+ myopen ("h", 0x43);
+ myopen ("i", 0x43, 0644, 0655);
+ return 0;
+}
gcc41-jdwp.patch:
--- NEW FILE gcc41-jdwp.patch ---
2007-09-24 Keith Seitz <keiths at redhat.com>
* include/jvm.h (struct natThread): Add new field 'frame'.
* include/java-interp.h (_Jv_Frame): Use _Jv_ThreadStackPeek,
_Jv_ThreadStackPop, and _Jv_ThreadStackPush instead of
java.lang.Thread.frame.
(~_Jv_Frame): Use _Jv_ThreadStackPop.
* java/lang/natThread.cc (_Jv_ThreadStackPeek): New function.
(_Jv_ThreadStackPush): New function.
(_Jv_ThreadStackPop): New function.
* java/lang/Thread.java (frame): Remove field to restore
C++ ABI compatibility.
* gnu/classpath/jdwp/natVMVirtualMachine.cc (getFrames): Use
_Jv_ThreadStackPeek.
(getFrame): Likewise.
* gnu/classpath/jdwp/natVMFrame.cc (getFrameDepth): Likewise.
* jvmti.cc (getLocalFrame): Likewise.
(_Jv_JVMTI_GetFrameCount): Likewise.
(_Jv_JVMTI_GetThreadState): Likewise.
(_Jv_JVMTI_GetStackTrace): Likewise.
* interpret.cc (_Jv_ReportJVMTIExceptionThrow): Likewise.
* headers.txt (java/lang/Thread.h): Prepend declarations
for _Jv_ThreadStackPeek, _Jv_ThreadStackPush, and _Jv_ThreadStackPop.
Add as friend functions.
* jni.cc (_Jv_JNIMethod::call): Push a frame onto the stack when
calling a JNI method.
--- libjava/interpret.cc (revision 128603)
+++ libjava/interpret.cc (working copy)
@@ -1709,7 +1709,7 @@
_Jv_ReportJVMTIExceptionThrow (jthrowable ex)
{
jthread thread = ::java::lang::Thread::currentThread ();
- _Jv_Frame *frame = reinterpret_cast<_Jv_Frame *> (thread->frame);
+ _Jv_Frame *frame = _Jv_ThreadStackPeek (thread);
jmethodID throw_meth = frame->self->get_method ();
jlocation throw_loc = -1;
if (frame->frame_type == frame_interpreter)
--- libjava/include/java-interp.h (revision 128603)
+++ libjava/include/java-interp.h (working copy)
@@ -391,14 +391,14 @@
{
self = s;
frame_type = type;
- next = (_Jv_Frame *) thr->frame;
- thr->frame = (gnu::gcj::RawData *) this;
+ next = _Jv_ThreadStackPeek (thr);
+ _Jv_ThreadStackPush (thr, this);
thread = thr;
}
~_Jv_Frame ()
{
- thread->frame = (gnu::gcj::RawData *) next;
+ _Jv_ThreadStackPop (thread);
}
int depth ()
--- libjava/include/jvm.h (revision 128603)
+++ libjava/include/jvm.h (working copy)
@@ -34,6 +34,8 @@
#include <sysdep/locks.h>
+class _Jv_Frame;
+
/* Macro for possible unused arguments. */
#define MAYBE_UNUSED __attribute__((__unused__))
@@ -767,6 +769,12 @@
// Each thread has its own JNI object.
_Jv_JNIEnv *jni_env;
+
+ // Describes the topmost frame in the thread's composite
+ // (interp + JNI) stack. Added here to maintain C++ ABI
+ // compatibility with previous versions. Newer versions
+ // of gcj put this in java/lang/Thread.java.
+ _Jv_Frame *frame;
};
#endif /* __JAVA_JVM_H__ */
--- libjava/jni.cc (revision 128603)
+++ libjava/jni.cc (working copy)
@@ -2343,6 +2343,10 @@
// Copy over passed-in arguments.
memcpy (&real_args[offset], args, _this->args_raw_size);
+ // Add a frame to the composite (interpreted + JNI) call stack
+ java::lang::Thread *thread = java::lang::Thread::currentThread ();
+ _Jv_NativeFrame nat_frame (_this, thread);
+
// The actual call to the JNI function.
#if FFI_NATIVE_RAW_API
ffi_raw_call (&_this->jni_cif, (void (*)()) _this->function,
--- libjava/jvmti.cc (revision 128603)
+++ libjava/jvmti.cc (working copy)
@@ -228,7 +228,7 @@
THREAD_CHECK_VALID (thread);
THREAD_CHECK_IS_ALIVE (thread);
- _Jv_Frame *frame = reinterpret_cast<_Jv_Frame *> (thread->frame);
+ _Jv_Frame *frame = _Jv_ThreadStackPeek (thread);
for (int i = 0; i < depth; i++)
{
@@ -516,7 +516,7 @@
THREAD_CHECK_VALID (thread);
THREAD_CHECK_IS_ALIVE (thread);
- _Jv_Frame *frame = reinterpret_cast<_Jv_Frame *> (thread->frame);
+ _Jv_Frame *frame = _Jv_ThreadStackPeek (thread);
(*frame_count) = frame->depth ();
return JVMTI_ERROR_NONE;
}
@@ -543,7 +543,7 @@
if (thread->isInterrupted ())
state |= JVMTI_THREAD_STATE_INTERRUPTED;
- _Jv_Frame *frame = reinterpret_cast<_Jv_Frame *> (thread->frame);
+ _Jv_Frame *frame = _Jv_ThreadStackPeek (thread);
if (frame != NULL && frame->frame_type == frame_native)
state |= JVMTI_THREAD_STATE_IN_NATIVE;
@@ -1273,7 +1273,7 @@
ILLEGAL_ARGUMENT (start_depth >= (*frame_count));
ILLEGAL_ARGUMENT (start_depth < (-(*frame_count)));
- _Jv_Frame *frame = reinterpret_cast<_Jv_Frame *> (thread->frame);
+ _Jv_Frame *frame = _Jv_ThreadStackPeek (thread);
// If start_depth is negative use this to determine at what depth to start
// the trace by adding it to the length of the call stack. This allows the
--- libjava/headers.txt (revision 128603)
+++ libjava/headers.txt (working copy)
@@ -6,6 +6,7 @@
class java/lang/Thread
prepend class _Jv_JNIEnv;
+prepend class _Jv_Frame;
prepend #define _JV_NOT_OWNER 1
prepend #define _JV_INTERRUPTED 2
prepend _Jv_JNIEnv * _Jv_GetCurrentJNIEnv ();
@@ -17,6 +18,9 @@
prepend jint _Jv_DetachCurrentThread ();
prepend struct _Jv_Thread_t;
prepend _Jv_Thread_t* _Jv_ThreadGetData (java::lang::Thread* thread);
+prepend _Jv_Frame *_Jv_ThreadStackPeek (java::lang::Thread *thread);
+prepend void _Jv_ThreadStackPush (java::lang::Thread *thread, _Jv_Frame *frame);
+prepend void _Jv_ThreadStackPop (java::lang::Thread *thread);
friend _Jv_JNIEnv * ::_Jv_GetCurrentJNIEnv ();
friend void ::_Jv_SetCurrentJNIEnv (_Jv_JNIEnv *env);
friend void ::_Jv_ThreadRun (java::lang::Thread* thread);
@@ -24,6 +28,9 @@
friend java::lang::Thread* ::_Jv_AttachCurrentThread (jstring name, java::lang::ThreadGroup* group);
friend java::lang::Thread* ::_Jv_AttachCurrentThreadAsDaemon (jstring name, java::lang::ThreadGroup* group);
friend jint (::_Jv_DetachCurrentThread) ();
+friend _Jv_Frame *::_Jv_ThreadStackPeek (java::lang::Thread *thread);
+friend void ::_Jv_ThreadStackPush (java::lang::Thread *thread, _Jv_Frame *frame);
+friend void ::_Jv_ThreadStackPop (java::lang::Thread *thread);
class java/lang/String
prepend jchar* _Jv_GetStringChars (jstring str);
--- libjava/gnu/classpath/jdwp/natVMFrame.cc (revision 128603)
+++ libjava/gnu/classpath/jdwp/natVMFrame.cc (working copy)
@@ -181,7 +181,7 @@
getFrameDepth (_Jv_Frame *frame)
{
jint depth = 0;
- _Jv_Frame *top_frame = (_Jv_Frame *) frame->thread->frame;
+ _Jv_Frame *top_frame = _Jv_ThreadStackPeek (frame->thread);
jint num_frames = VMVirtualMachine::getFrameCount (frame->thread);
while (frame != top_frame)
--- libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc (revision 128603)
+++ libjava/gnu/classpath/jdwp/natVMVirtualMachine.cc (working copy)
@@ -553,7 +553,7 @@
frame_list = new ::java::util::ArrayList (num_frames);
- _Jv_Frame *vm_frame = reinterpret_cast<_Jv_Frame *> (thread->frame);
+ _Jv_Frame *vm_frame = _Jv_ThreadStackPeek (thread);
// Take start frames off the top of the stack
while (vm_frame != NULL && start > 0)
@@ -584,7 +584,7 @@
{
using namespace gnu::classpath::jdwp::exception;
- _Jv_Frame *vm_frame = (_Jv_Frame *) thread->frame;
+ _Jv_Frame *vm_frame = _Jv_ThreadStackPeek (thread);
jint depth = 0;
_Jv_Frame *frame = reinterpret_cast<_Jv_Frame *> (frameID);
--- libjava/java/lang/Thread.java (revision 128603)
+++ libjava/java/lang/Thread.java (working copy)
@@ -186,9 +186,6 @@
// This describes the top-most interpreter frame for this thread.
RawData interp_frame;
- // This describes the top most frame in the composite (interp + JNI) stack
- RawData frame;
-
// Current state.
volatile int state;
--- libjava/java/lang/natThread.cc (revision 128603)
+++ libjava/java/lang/natThread.cc (working copy)
@@ -15,6 +15,7 @@
#include <gcj/cni.h>
#include <jvm.h>
#include <java-threads.h>
+#include <java-interp.h>
#include <gnu/gcj/RawDataManaged.h>
#include <java/lang/Thread.h>
@@ -525,3 +526,25 @@
return 0;
}
+
+_Jv_Frame *
+_Jv_ThreadStackPeek (java::lang::Thread *thread)
+{
+ struct natThread *nt = (natThread *) thread->data;
+ return nt->frame;
+}
+
+void
+_Jv_ThreadStackPush (java::lang::Thread *thread, _Jv_Frame *frame)
+{
+ struct natThread *nt = (natThread *) thread->data;
+ nt->frame = frame;
+}
+
+void
+_Jv_ThreadStackPop (java::lang::Thread *thread)
+{
+ struct natThread *nt = (natThread *) thread->data;
+ _Jv_Frame *next = nt->frame->next;
+ nt->frame = next;
+}
gcc41-pr20880.patch:
--- NEW FILE gcc41-pr20880.patch ---
2006-11-24 Paul Thomas <pault at gcc.gnu.org>
PR fortran/20880
* parse.c (parse_interface): Error if procedure name is that of
encompassing scope.
* gfortran.dg/interface_3a.f90: New test.
--- gcc/fortran/parse.c (revision 119172)
+++ gcc/fortran/parse.c (revision 119173)
@@ -1694,6 +1694,7 @@ parse_interface (void)
gfc_interface_info save;
gfc_state_data s1, s2;
gfc_statement st;
+ locus proc_locus;
accept_statement (ST_INTERFACE);
@@ -1781,6 +1782,7 @@ loop:
accept_statement (st);
prog_unit = gfc_new_block;
prog_unit->formal_ns = gfc_current_ns;
+ proc_locus = gfc_current_locus;
decl:
/* Read data declaration statements. */
@@ -1796,8 +1798,15 @@ decl:
current_interface = save;
gfc_add_interface (prog_unit);
-
pop_state ();
+
+ if (current_interface.ns
+ && current_interface.ns->proc_name
+ && strcmp (current_interface.ns->proc_name->name,
+ prog_unit->name) == 0)
+ gfc_error ("INTERFACE procedure '%s' at %L has the same name as the "
+ "enclosing procedure", prog_unit->name, &proc_locus);
+
goto loop;
done:
--- gcc/testsuite/gfortran.dg/interface_3a.f90
+++ gcc/testsuite/gfortran.dg/interface_3a.f90
@@ -0,0 +1,13 @@
+! { dg-do compile }
+! Contributed by Joost VandeVondele <jv244 at cam.ac.uk>
+!
+! This was found whilst investigating => segfault
+subroutine thy_sub (a)
+ interface
+ subroutine thy_sub (a) ! { dg-error "enclosing procedure" }
+ real a
+ end subroutine
+ end interface
+ real a
+ print *, a
+end subroutine
gcc41-pr32694.patch:
--- NEW FILE gcc41-pr32694.patch ---
2007-09-25 Jakub Jelinek <jakub at redhat.com>
PR tree-optimization/32694
2006-11-08 Roger Sayle <roger at eyesopen.com>
* tree-ssa-propagate.c (set_rhs): Verify tcc_comparison the same way
as tcc_binary.
* gcc.c-torture/compile/20070925-1.c: New test.
--- gcc/tree-ssa-propagate.c.jj 2007-09-23 19:43:36.000000000 +0200
+++ gcc/tree-ssa-propagate.c 2007-09-25 09:30:50.000000000 +0200
@@ -570,7 +570,8 @@ set_rhs (tree *stmt_p, tree expr)
ssa_op_iter iter;
/* Verify the constant folded result is valid gimple. */
- if (TREE_CODE_CLASS (code) == tcc_binary)
+ if (TREE_CODE_CLASS (code) == tcc_binary
+ || TREE_CODE_CLASS (code) == tcc_comparison)
{
if (!is_gimple_val (TREE_OPERAND (expr, 0))
|| !is_gimple_val (TREE_OPERAND (expr, 1)))
--- gcc/testsuite/gcc.c-torture/compile/20070925-1.c.jj 2007-09-25 09:28:37.000000000 +0200
+++ gcc/testsuite/gcc.c-torture/compile/20070925-1.c 2007-09-25 09:29:41.000000000 +0200
@@ -0,0 +1,22 @@
+/* PR tree-optimization/32694 */
+
+typedef signed long long int WordS64;
+typedef unsigned long long int Word64;
+
+int
+foo (Word64 * p)
+{
+ while (1)
+ {
+ WordS64 c = 0x1llu;
+ WordS64 x = *p;
+ if (c >= 0)
+ {
+ if (x > (WordS64) 0x7FFFFFFFFFFFFFFFll - c)
+ return 6;
+ }
+ else if (x < (WordS64) 0x8000000000000000ll - c)
+ return 7;
+ p++;
+ }
+}
gcc41-pr33506.patch:
--- NEW FILE gcc41-pr33506.patch ---
2007-09-21 Jakub Jelinek <jakub at redhat.com>
PR c++/33506
* langhooks.h (struct lang_hooks_for_types): Add type_hash_eq
field.
* langhooks.c (lhd_type_hash_eq): New function.
* langhooks-def.h (lhd_type_hash_eq): New prototype.
(LANG_HOOKS_TYPE_HASH_EQ): Define.
(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add LANG_HOOKS_TYPE_HASH_EQ.
* tree.c (type_hash_eq): For FUNCTION_TYPE use
lang_hooks.type.type_hash_eq in addition to generic tests.
* cp-tree.h (cxx_type_hash_eq): New prototype.
* cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
* tree.c (cxx_type_hash_eq): New function.
* g++.dg/ext/attrib29.C: New test.
--- gcc/langhooks.h.jj 2007-02-20 16:39:12.000000000 -0500
+++ gcc/langhooks.h 2007-09-22 03:46:10.000000000 -0400
@@ -148,6 +148,10 @@ struct lang_hooks_for_types
firstprivate variables. */
void (*omp_firstprivatize_type_sizes) (struct gimplify_omp_ctx *, tree);
+ /* Return TRUE if TYPE1 and TYPE2 are identical for type hashing purposes.
+ Called only after doing all language independent checks. */
+ bool (*type_hash_eq) (tree, tree);
+
/* Nonzero if types that are identical are to be hashed so that only
one copy is kept. If a language requires unique types for each
user-specified type, such as Ada, this should be set to TRUE. */
--- gcc/langhooks.c.jj 2007-02-20 16:39:12.000000000 -0500
+++ gcc/langhooks.c 2007-09-22 03:46:10.000000000 -0400
@@ -411,6 +411,16 @@ lhd_tree_dump_type_quals (tree t)
/* lang_hooks.expr_size: Determine the size of the value of an expression T
in a language-specific way. Returns a tree for the size in bytes. */
+/* Return TRUE if TYPE1 and TYPE2 are identical for type hashing purposes.
+ Called only after doing all language independent checks. */
+
+bool
+lhd_type_hash_eq (tree typea ATTRIBUTE_UNUSED,
+ tree typeb ATTRIBUTE_UNUSED)
+{
+ return true;
+}
+
tree
lhd_expr_size (tree exp)
{
--- gcc/langhooks-def.h.jj 2007-02-20 16:39:13.000000000 -0500
+++ gcc/langhooks-def.h 2007-09-22 03:46:56.000000000 -0400
@@ -70,6 +70,7 @@ extern tree lhd_expr_size (tree);
extern size_t lhd_tree_size (enum tree_code);
extern HOST_WIDE_INT lhd_to_target_charset (HOST_WIDE_INT);
extern tree lhd_expr_to_decl (tree, bool *, bool *, bool *);
+extern bool lhd_type_hash_eq (tree, tree);
/* Declarations of default tree inlining hooks. */
extern tree lhd_tree_inlining_walk_subtrees (tree *, int *, walk_tree_fn,
@@ -220,6 +221,7 @@ extern tree lhd_make_node (enum tree_cod
#define LANG_HOOKS_TYPE_MAX_SIZE lhd_return_null_tree
#define LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES \
lhd_omp_firstprivatize_type_sizes
+#define LANG_HOOKS_TYPE_HASH_EQ lhd_type_hash_eq
#define LANG_HOOKS_HASH_TYPES true
#define LANG_HOOKS_FOR_TYPES_INITIALIZER { \
@@ -234,6 +236,7 @@ extern tree lhd_make_node (enum tree_cod
LANG_HOOKS_INCOMPLETE_TYPE_ERROR, \
LANG_HOOKS_TYPE_MAX_SIZE, \
LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES, \
+ LANG_HOOKS_TYPE_HASH_EQ, \
LANG_HOOKS_HASH_TYPES \
}
--- gcc/tree.c.jj 2007-04-03 07:18:26.000000000 -0400
+++ gcc/tree.c 2007-09-22 03:46:10.000000000 -0400
@@ -4168,17 +4168,21 @@ type_hash_eq (const void *va, const void
TYPE_FIELDS (b->type))));
case FUNCTION_TYPE:
- return (TYPE_ARG_TYPES (a->type) == TYPE_ARG_TYPES (b->type)
- || (TYPE_ARG_TYPES (a->type)
- && TREE_CODE (TYPE_ARG_TYPES (a->type)) == TREE_LIST
- && TYPE_ARG_TYPES (b->type)
- && TREE_CODE (TYPE_ARG_TYPES (b->type)) == TREE_LIST
- && type_list_equal (TYPE_ARG_TYPES (a->type),
- TYPE_ARG_TYPES (b->type))));
+ if (TYPE_ARG_TYPES (a->type) == TYPE_ARG_TYPES (b->type)
+ || (TYPE_ARG_TYPES (a->type)
+ && TREE_CODE (TYPE_ARG_TYPES (a->type)) == TREE_LIST
+ && TYPE_ARG_TYPES (b->type)
+ && TREE_CODE (TYPE_ARG_TYPES (b->type)) == TREE_LIST
+ && type_list_equal (TYPE_ARG_TYPES (a->type),
+ TYPE_ARG_TYPES (b->type))))
+ break;
+ return 0;
default:
return 0;
}
+
+ return lang_hooks.types.type_hash_eq (a->type, b->type);
}
/* Return the cached hash value. */
--- gcc/cp/cp-tree.h.jj 2007-06-26 07:57:09.000000000 -0400
+++ gcc/cp/cp-tree.h 2007-09-22 03:50:22.000000000 -0400
@@ -4421,7 +4421,8 @@ extern tree cp_add_pending_fn_decls (vo
extern int cp_auto_var_in_fn_p (tree,tree);
extern tree fold_if_not_in_template (tree);
extern tree rvalue (tree);
-
+extern bool cxx_type_hash_eq (tree, tree);
+
/* in typeck.c */
extern int string_conv_p (tree, tree, int);
extern tree cp_truthvalue_conversion (tree);
--- gcc/cp/cp-objcp-common.h.jj 2007-02-20 16:37:34.000000000 -0500
+++ gcc/cp/cp-objcp-common.h 2007-09-22 03:49:38.000000000 -0400
@@ -85,6 +85,8 @@ extern tree objcp_tsubst_copy_and_build
#define LANG_HOOKS_WRITE_GLOBALS lhd_do_nothing
#undef LANG_HOOKS_COMDAT_GROUP
#define LANG_HOOKS_COMDAT_GROUP cxx_comdat_group
+#undef LANG_HOOKS_TYPE_HASH_EQ
+#define LANG_HOOKS_TYPE_HASH_EQ cxx_type_hash_eq
#undef LANG_HOOKS_FUNCTION_INIT
#define LANG_HOOKS_FUNCTION_INIT cxx_push_function_context
--- gcc/cp/tree.c.jj 2007-03-12 03:28:01.000000000 -0400
+++ gcc/cp/tree.c 2007-09-22 03:46:10.000000000 -0400
@@ -1959,6 +1959,22 @@ cp_build_type_attribute_variant (tree ty
return new_type;
}
+/* Return TRUE if TYPE1 and TYPE2 are identical for type hashing purposes.
+ Called only after doing all language independent checks. Only
+ to check TYPE_RAISES_EXCEPTIONS for FUNCTION_TYPE, the rest is already
+ compared in type_hash_eq. */
+
+bool
+cxx_type_hash_eq (tree typea, tree typeb)
+{
+ if (TREE_CODE (typea) != FUNCTION_TYPE
+ || TYPE_RAISES_EXCEPTIONS (typea) == TYPE_RAISES_EXCEPTIONS (typeb))
+ return true;
+
+ return comp_except_specs (TYPE_RAISES_EXCEPTIONS (typea),
+ TYPE_RAISES_EXCEPTIONS (typeb), 1);
+}
+
/* Apply FUNC to all language-specific sub-trees of TP in a pre-order
traversal. Called from walk_tree. */
--- gcc/testsuite/g++.dg/ext/attrib29.C.jj 2007-09-22 03:46:10.000000000 -0400
+++ gcc/testsuite/g++.dg/ext/attrib29.C 2007-09-22 03:46:10.000000000 -0400
@@ -0,0 +1,10 @@
+// PR c++/33506
+// { dg-do compile }
+
+extern int f1 (char *) __attribute__ ((warn_unused_result));
+extern int f2 (char *) throw () __attribute__ ((warn_unused_result));
+extern int f2 (char *) throw ();
+
+extern int f3 (char *) __attribute__ ((nonnull (1)));
+extern int f4 (char *) throw () __attribute__ ((nonnull (1)));
+extern int f4 (char *) throw ();
Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/gcc/F-7/.cvsignore,v
retrieving revision 1.207
retrieving revision 1.208
diff -u -r1.207 -r1.208
--- .cvsignore 27 Aug 2007 11:08:53 -0000 1.207
+++ .cvsignore 25 Sep 2007 23:17:10 -0000 1.208
@@ -1 +1 @@
-gcc-4.1.2-20070821.tar.bz2
+gcc-4.1.2-20070925.tar.bz2
Index: gcc41.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gcc/F-7/gcc41.spec,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -r1.166 -r1.167
--- gcc41.spec 17 Sep 2007 22:10:17 -0000 1.166
+++ gcc41.spec 25 Sep 2007 23:17:11 -0000 1.167
@@ -1,6 +1,6 @@
-%define DATE 20070821
+%define DATE 20070925
%define gcc_version 4.1.2
-%define gcc_release 24
+%define gcc_release 27
%define _unpackaged_files_terminate_build 0
%define multilib_64_archs sparc64 ppc64 s390x x86_64
%define include_gappletviewer 1
@@ -136,22 +136,13 @@
Patch22: gcc41-build-id.patch
Patch23: gcc41-pr28690.patch
Patch24: gcc41-rh247256.patch
-Patch25: gcc41-pr22244.patch
-Patch26: gcc41-pr32678.patch
-Patch27: gcc41-pr32912.patch
-Patch28: gcc41-sparc-niagara.patch
-Patch29: gcc41-ppc-tramp.patch
-Patch30: gcc41-rh253102.patch
-Patch31: gcc41-c++-gnu_inline.patch
-Patch32: gcc41-ppc-sync-qihi.patch
-Patch33: gcc41-ppc64-ia64-GNU-stack.patch
-Patch34: gcc41-builtin-chk-anticipated.patch
-Patch35: gcc41-builtin-throw.patch
-Patch36: gcc41-builtin-va-arg-pack.patch
-Patch37: gcc41-builtin-va-arg-pack-len.patch
-Patch38: gcc41-pr27954.patch
-Patch39: gcc41-pr33423.patch
-Patch40: gcc41-scanf-fmt-check.patch
+Patch25: gcc41-ppc64-ia64-GNU-stack.patch
+Patch26: gcc41-pr33506.patch
+Patch27: gcc41-artificial-attrib.patch
+Patch28: gcc41-error-attrib.patch
+Patch29: gcc41-jdwp.patch
+Patch30: gcc41-pr20880.patch
+Patch31: gcc41-pr32694.patch
# On ARM EABI systems, we do want -gnueabi to be part of the
# target triple.
@@ -459,22 +450,13 @@
#%patch22 -p0 -b .build-id~
%patch23 -p0 -b .pr28690~
%patch24 -p0 -b .rh247256~
-%patch25 -p0 -b .pr22244~
-%patch26 -p0 -b .pr32678~
-%patch27 -p0 -b .pr32912~
-%patch28 -p0 -b .sparc-niagara~
-%patch29 -p0 -b .ppc-tramp~
-%patch30 -p0 -b .rh253102~
-%patch31 -p0 -b .c++-gnu_inline~
-%patch32 -p0 -b .ppc-sync-qihi~
-%patch33 -p0 -b .ppc64-ia64-GNU-stack~
-%patch34 -p0 -b .builtin-chk-anticipated~
-%patch35 -p0 -b .builtin-throw~
-%patch36 -p0 -b .builtin-va-arg-pack~
-%patch37 -p0 -b .builtin-va-arg-pack-len~
-%patch38 -p0 -b .pr27954~
-%patch39 -p0 -b .pr33423~
-%patch40 -p0 -b .scanf-fmt-check~
+%patch25 -p0 -b .ppc64-ia64-GNU-stack~
+%patch26 -p0 -b .pr33506~
+%patch27 -p0 -b .artificial-attrib~
+%patch28 -p0 -b .error-attrib~
+%patch29 -p0 -b .jdwp~
+%patch30 -p0 -b .pr20880~
+%patch31 -p0 -b .pr32694~
sed -i -e 's/4\.1\.3/4.1.2/' gcc/BASE-VER gcc/version.c
sed -i -e 's/" (Red Hat[^)]*)"/" (Red Hat %{version}-%{gcc_release})"/' gcc/version.c
@@ -1629,6 +1611,20 @@
%doc rpm.doc/changelogs/libmudflap/ChangeLog*
%changelog
+* Tue Sep 25 2007 Jakub Jelinek <jakub at redhat.com> 4.1.2-27.fc7
+- update from gcc-4_1-branch (-r127672:128736)
+ - PRs bootstrap/33418, c++/31941, c++/32113, java/31842, target/33256,
+ tree-optimization/33142
+- add support for artificial, error and warning attributes
+- restore Java CNI ABI compatibility broken by JDWP changes (Keith Seitz)
+- fix ICE with set_rhs allowing non-gimple (Roger Sayle, #247407,
+ PR tree-optimization/32694)
+- fix ICE on Fortran interface-body declaring current subroutine name
+ (Paul Thomas, #300851, PR fortran/20880)
+- don't ignore throw specification of function types in type hashing
+ (PR c++/33506)
+- handle makeinfo version >= 4.10 in gcc configury
+
* Mon Sep 17 2007 Jakub Jelinek <jakub at redhat.com> 4.1.2-24.fc7
- fix ICE on __builtin_mem*_chk if it couldn't be folded until
expand time and at that point it can avoid a call (PR middle-end/33423)
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/gcc/F-7/sources,v
retrieving revision 1.209
retrieving revision 1.210
diff -u -r1.209 -r1.210
--- sources 27 Aug 2007 11:08:53 -0000 1.209
+++ sources 25 Sep 2007 23:17:11 -0000 1.210
@@ -1 +1 @@
-65778706d6b9c029a06fca968a45ab7f gcc-4.1.2-20070821.tar.bz2
+562ab2446c60a9145da385ac56cf7715 gcc-4.1.2-20070925.tar.bz2
--- gcc41-builtin-chk-anticipated.patch DELETED ---
--- gcc41-builtin-throw.patch DELETED ---
--- gcc41-builtin-va-arg-pack-len.patch DELETED ---
--- gcc41-builtin-va-arg-pack.patch DELETED ---
--- gcc41-c++-gnu_inline.patch DELETED ---
--- gcc41-ppc-sync-qihi.patch DELETED ---
--- gcc41-ppc-tramp.patch DELETED ---
--- gcc41-pr22244.patch DELETED ---
--- gcc41-pr27954.patch DELETED ---
--- gcc41-pr32678.patch DELETED ---
--- gcc41-pr32912.patch DELETED ---
--- gcc41-pr33423.patch DELETED ---
--- gcc41-rh253102.patch DELETED ---
--- gcc41-scanf-fmt-check.patch DELETED ---
--- gcc41-sparc-niagara.patch DELETED ---
- Previous message (by thread): rpms/eclipse-demos/devel .cvsignore, NONE, 1.1 Makefile, NONE, 1.1 sources, NONE, 1.1
- Next message (by thread): rpms/gwget/devel gwget-0.99-epiphany.patch, NONE, 1.1 gwget.spec, 1.22, 1.23 gwget-0.99-epiphany220.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list