rpms/gcc/devel 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 .cvsignore, 1.212, 1.213 gcc41-pr28755.patch, 1.1, 1.2 gcc41.spec, 1.176, 1.177 sources, 1.214, 1.215 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-makeinfo-ver.patch, 1.4, 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.2, 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 16:09:37 UTC 2007
Author: jakub
Update of /cvs/pkgs/rpms/gcc/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26325
Modified Files:
.cvsignore gcc41-pr28755.patch gcc41.spec sources
Added Files:
gcc41-artificial-attrib.patch gcc41-error-attrib.patch
gcc41-jdwp.patch gcc41-pr20880.patch gcc41-pr32694.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-makeinfo-ver.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-28
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++;
+ }
+}
Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/gcc/devel/.cvsignore,v
retrieving revision 1.212
retrieving revision 1.213
diff -u -r1.212 -r1.213
--- .cvsignore 21 Aug 2007 19:33:58 -0000 1.212
+++ .cvsignore 25 Sep 2007 16:09:05 -0000 1.213
@@ -1 +1 @@
-gcc-4.1.2-20070821.tar.bz2
+gcc-4.1.2-20070925.tar.bz2
gcc41-pr28755.patch:
Index: gcc41-pr28755.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gcc/devel/gcc41-pr28755.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- gcc41-pr28755.patch 18 Aug 2006 07:38:36 -0000 1.1
+++ gcc41-pr28755.patch 25 Sep 2007 16:09:05 -0000 1.2
@@ -1,44 +1,210 @@
-2006-08-17 Jakub Jelinek <jakub at redhat.com>
+2007-09-23 Jakub Jelinek <jakub at redhat.com>
PR middle-end/28755
- * expr.c (expand_expr_real_1) <case ARRAY_REF>: Make sure
- the const array field optimization doesn't create an extra constant
- MEM.
+ * expr.c (expand_constructor): New function.
+ (expand_expr_real_1) <case CONSTRUCTOR>: Call it.
+ (expand_expr_real_1) <case ARRAY_REF>: Call it if VALUE is
+ CONSTRUCTOR.
* gcc.dg/pr28755.c: New test.
---- gcc/expr.c.jj 2006-08-09 17:54:03.000000000 +0200
-+++ gcc/expr.c 2006-08-17 13:00:33.000000000 +0200
-@@ -7105,13 +7105,25 @@ expand_expr_real_1 (tree exp, rtx target
+--- gcc/expr.c (revision 128684)
++++ gcc/expr.c (revision 128685)
+@@ -6435,6 +6435,89 @@ expand_expr_addr_expr (tree exp, rtx tar
+ return result;
+ }
+
++/* Generate code for computing CONSTRUCTOR EXP.
++ An rtx for the computed value is returned. If AVOID_TEMP_MEM
++ is TRUE, instead of creating a temporary variable in memory
++ NULL is returned and the caller needs to handle it differently. */
++
++static rtx
++expand_constructor (tree exp, rtx target, enum expand_modifier modifier,
++ bool avoid_temp_mem)
++{
++ tree type = TREE_TYPE (exp);
++ enum machine_mode mode = TYPE_MODE (type);
++
++ /* Try to avoid creating a temporary at all. This is possible
++ if all of the initializer is zero.
++ FIXME: try to handle all [0..255] initializers we can handle
++ with memset. */
++ if (TREE_STATIC (exp)
++ && !TREE_ADDRESSABLE (exp)
++ && target != 0 && mode == BLKmode
++ && all_zeros_p (exp))
++ {
++ clear_storage (target, expr_size (exp), BLOCK_OP_NORMAL);
++ return target;
++ }
++
++ /* All elts simple constants => refer to a constant in memory. But
++ if this is a non-BLKmode mode, let it store a field at a time
++ since that should make a CONST_INT or CONST_DOUBLE when we
++ fold. Likewise, if we have a target we can use, it is best to
++ store directly into the target unless the type is large enough
++ that memcpy will be used. If we are making an initializer and
++ all operands are constant, put it in memory as well.
++
++ FIXME: Avoid trying to fill vector constructors piece-meal.
++ Output them with output_constant_def below unless we're sure
++ they're zeros. This should go away when vector initializers
++ are treated like VECTOR_CST instead of arrays. */
++ if ((TREE_STATIC (exp)
++ && ((mode == BLKmode
++ && ! (target != 0 && safe_from_p (target, exp, 1)))
++ || TREE_ADDRESSABLE (exp)
++ || (host_integerp (TYPE_SIZE_UNIT (type), 1)
++ && (! MOVE_BY_PIECES_P
++ (tree_low_cst (TYPE_SIZE_UNIT (type), 1),
++ TYPE_ALIGN (type)))
++ && ! mostly_zeros_p (exp))))
++ || ((modifier == EXPAND_INITIALIZER || modifier == EXPAND_CONST_ADDRESS)
++ && TREE_CONSTANT (exp)))
++ {
++ rtx constructor;
++
++ if (avoid_temp_mem)
++ return NULL_RTX;
++
++ constructor = output_constant_def (exp, 1);
++
++ if (modifier != EXPAND_CONST_ADDRESS
++ && modifier != EXPAND_INITIALIZER
++ && modifier != EXPAND_SUM)
++ constructor = validize_mem (constructor);
++
++ return constructor;
++ }
++
++ /* Handle calls that pass values in multiple non-contiguous
++ locations. The Irix 6 ABI has examples of this. */
++ if (target == 0 || ! safe_from_p (target, exp, 1)
++ || GET_CODE (target) == PARALLEL || modifier == EXPAND_STACK_PARM)
++ {
++ if (avoid_temp_mem)
++ return NULL_RTX;
++
++ target
++ = assign_temp (build_qualified_type (type, (TYPE_QUALS (type)
++ | (TREE_READONLY (exp)
++ * TYPE_QUAL_CONST))),
++ 0, TREE_ADDRESSABLE (exp), 1);
++ }
++
++ store_constructor (exp, target, 0, int_expr_size (exp));
++ return target;
++}
++
+
+ /* expand_expr: generate code for computing expression EXP.
+ An rtx for the computed value is returned. The value is never null.
+@@ -6899,71 +6982,7 @@ expand_expr_real_1 (tree exp, rtx target
+ return const0_rtx;
+ }
+
+- /* Try to avoid creating a temporary at all. This is possible
+- if all of the initializer is zero.
+- FIXME: try to handle all [0..255] initializers we can handle
+- with memset. */
+- else if (TREE_STATIC (exp)
+- && !TREE_ADDRESSABLE (exp)
+- && target != 0 && mode == BLKmode
+- && all_zeros_p (exp))
+- {
+- clear_storage (target, expr_size (exp), BLOCK_OP_NORMAL);
+- return target;
+- }
+-
+- /* All elts simple constants => refer to a constant in memory. But
+- if this is a non-BLKmode mode, let it store a field at a time
+- since that should make a CONST_INT or CONST_DOUBLE when we
+- fold. Likewise, if we have a target we can use, it is best to
+- store directly into the target unless the type is large enough
+- that memcpy will be used. If we are making an initializer and
+- all operands are constant, put it in memory as well.
+-
+- FIXME: Avoid trying to fill vector constructors piece-meal.
+- Output them with output_constant_def below unless we're sure
+- they're zeros. This should go away when vector initializers
+- are treated like VECTOR_CST instead of arrays.
+- */
+- else if ((TREE_STATIC (exp)
+- && ((mode == BLKmode
+- && ! (target != 0 && safe_from_p (target, exp, 1)))
+- || TREE_ADDRESSABLE (exp)
+- || (host_integerp (TYPE_SIZE_UNIT (type), 1)
+- && (! MOVE_BY_PIECES_P
+- (tree_low_cst (TYPE_SIZE_UNIT (type), 1),
+- TYPE_ALIGN (type)))
+- && ! mostly_zeros_p (exp))))
+- || ((modifier == EXPAND_INITIALIZER
+- || modifier == EXPAND_CONST_ADDRESS)
+- && TREE_CONSTANT (exp)))
+- {
+- rtx constructor = output_constant_def (exp, 1);
+-
+- if (modifier != EXPAND_CONST_ADDRESS
+- && modifier != EXPAND_INITIALIZER
+- && modifier != EXPAND_SUM)
+- constructor = validize_mem (constructor);
+-
+- return constructor;
+- }
+- else
+- {
+- /* Handle calls that pass values in multiple non-contiguous
+- locations. The Irix 6 ABI has examples of this. */
+- if (target == 0 || ! safe_from_p (target, exp, 1)
+- || GET_CODE (target) == PARALLEL
+- || modifier == EXPAND_STACK_PARM)
+- target
+- = assign_temp (build_qualified_type (type,
+- (TYPE_QUALS (type)
+- | (TREE_READONLY (exp)
+- * TYPE_QUAL_CONST))),
+- 0, TREE_ADDRESSABLE (exp), 1);
+-
+- store_constructor (exp, target, 0, int_expr_size (exp));
+- return target;
+- }
++ return expand_constructor (exp, target, modifier, false);
+
+ case MISALIGNED_INDIRECT_REF:
+ case ALIGN_INDIRECT_REF:
+@@ -7105,10 +7124,25 @@ expand_expr_real_1 (tree exp, rtx target
field, value)
if (tree_int_cst_equal (field, index))
{
- if (!TREE_SIDE_EFFECTS (value))
+- return expand_expr (fold (value), target, tmode,
+- modifier);
+- break;
+ if (TREE_SIDE_EFFECTS (value))
+ break;
+
-+ if (TREE_CODE (value) != CONSTRUCTOR)
- return expand_expr (fold (value), target, tmode,
- modifier);
-+
-+ /* For CONSTRUCTOR this optimization is not always
-+ a win - if expand_expr creates a temporary
-+ constant, we just waste unnecessarily rodata
-+ space. */
-+ temp = expand_expr (value, target, tmode, modifier);
-+ if (temp == target
-+ || (temp && GET_CODE (temp) != MEM))
-+ return temp;
- break;
++ if (TREE_CODE (value) == CONSTRUCTOR)
++ {
++ /* If VALUE is a CONSTRUCTOR, this
++ optimization is only useful if
++ this doesn't store the CONSTRUCTOR
++ into memory. If it does, it is more
++ efficient to just load the data from
++ the array directly. */
++ rtx ret = expand_constructor (value, target,
++ modifier, true);
++ if (ret == NULL_RTX)
++ break;
++ }
++
++ return expand_expr (fold (value), target, tmode,
++ modifier);
}
}
-- else if(TREE_CODE (init) == STRING_CST)
-+ else if (TREE_CODE (init) == STRING_CST)
- {
- tree index1 = index;
- tree low_bound = array_ref_low_bound (exp);
---- gcc/testsuite/gcc.dg/pr28755.c.jj 2006-08-17 12:59:57.000000000 +0200
-+++ gcc/testsuite/gcc.dg/pr28755.c 2006-08-17 12:59:57.000000000 +0200
+ else if(TREE_CODE (init) == STRING_CST)
+--- gcc/testsuite/gcc.dg/pr28755.c (revision 0)
++++ gcc/testsuite/gcc.dg/pr28755.c (revision 128685)
@@ -0,0 +1,22 @@
+/* PR middle-end/28755 */
+/* { dg-do compile } */
Index: gcc41.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gcc/devel/gcc41.spec,v
retrieving revision 1.176
retrieving revision 1.177
diff -u -r1.176 -r1.177
--- gcc41.spec 22 Sep 2007 12:45:46 -0000 1.176
+++ gcc41.spec 25 Sep 2007 16:09:05 -0000 1.177
@@ -1,6 +1,6 @@
-%define DATE 20070821
+%define DATE 20070925
%define gcc_version 4.1.2
-%define gcc_release 26
+%define gcc_release 28
%define _unpackaged_files_terminate_build 0
%define multilib_64_archs sparc64 ppc64 s390x x86_64
%define include_gappletviewer 1
@@ -138,24 +138,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
-Patch41: gcc41-pr33506.patch
-Patch42: gcc41-makeinfo-ver.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.
@@ -463,24 +452,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~
-%patch41 -p0 -b .pr33506~
-%patch42 -p0 -b .makeinfo-ver~
+%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
@@ -1635,6 +1613,17 @@
%doc rpm.doc/changelogs/libmudflap/ChangeLog*
%changelog
+* Tue Sep 25 2007 Jakub Jelinek <jakub at redhat.com> 4.1.2-28
+- 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)
+
* Sat Sep 22 2007 Jakub Jelinek <jakub at redhat.com> 4.1.2-26
- don't ignore throw specification of function types in type hashing
(PR c++/33506)
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/gcc/devel/sources,v
retrieving revision 1.214
retrieving revision 1.215
diff -u -r1.214 -r1.215
--- sources 21 Aug 2007 19:33:58 -0000 1.214
+++ sources 25 Sep 2007 16:09:05 -0000 1.215
@@ -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-makeinfo-ver.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 ---
More information about the fedora-extras-commits
mailing list