Re: PATCH: Properly set ix86_gen_leave and ix86_gen_monitor

2012-03-12 Thread Uros Bizjak
On Mon, Mar 12, 2012 at 12:02 AM, H.J. Lu  wrote:

> leave_rex64 works on DImode and sse3_monitor64 works on Pmode.  This
> patch properly sets ix86_gen_leave and ix86_gen_monitor, depending on
> TARGET_64BIT and Pmode.  Tested on Linux/x86-64.  OK for trunk?
>
> 2012-03-11  H.J. Lu  
>
>        * config/i386/i386.c (ix86_option_override_internal): Properly
>        set ix86_gen_leave and ix86_gen_monitor.  Check Pmode == DImode.
>
>        * config/i386/sse.md (sse3_monitor64): Renamed to ...
>        (sse3_monitor64_): This.

Please provide more descriptive ChangeLog. You are changing the check
on quite some global variables, please state them explicitly.

Otherwise the patch is OK.

BTW: I sincerely hope you reviewed all the places where these globals
are used...

Uros.


Re: PATCH: Call gen_tls_global_dynamic_64_ and en_tls_local_dynamic_base_64_

2012-03-12 Thread Uros Bizjak
On Mon, Mar 12, 2012 at 12:26 AM, H.J. Lu  wrote:

> Pmode may be DImode for x32.  This patch calls
> gen_tls_global_dynamic_64_ and gen_tls_local_dynamic_base_64_,
> depending on Pmode.  Tested on Linux/x86-64.  OK for trunk?
>
> 2012-03-11  H.J. Lu  
>
>        * config/i386/i386.c (legitimize_tls_address): Call
>        gen_tls_global_dynamic_64_ and
>        gen_tls_local_dynamic_base_64_, depending on Pmode.
>
>        * config/i386/i386.md (*tls_global_dynamic_64): Renamed to ...
>        (*tls_global_dynamic_64_): This.
>        (tls_global_dynamic_64): Renamed to ...
>        (tls_global_dynamic_64_): This.
>        (*tls_local_dynamic_base_64): Renamed to ...
>        (*tls_local_dynamic_base_64): This.
>        (tls_local_dynamic_base_64): Renamed to ...
>        (tls_local_dynamic_base_64): This.
>
> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
> index d673101..fc8fa12 100644
> --- a/gcc/config/i386/i386.c
> +++ b/gcc/config/i386/i386.c
> @@ -12533,7 +12543,12 @@ legitimize_tls_address (rtx x, enum tls_model model, 
> bool for_mov)
>              rtx rax = gen_rtx_REG (Pmode, AX_REG), insns;
>
>              start_sequence ();
> -             emit_call_insn (gen_tls_global_dynamic_64 (rax, x, caddr));
> +             if (Pmode == DImode)
> +               emit_call_insn (gen_tls_global_dynamic_64_di (rax, x,
> +                                                             caddr));
> +             else
> +               emit_call_insn (gen_tls_global_dynamic_64_si (rax, x,
> +                                                             caddr));
>              insns = get_insns ();
>              end_sequence ();
>
> @@ -12581,7 +12596,12 @@ legitimize_tls_address (rtx x, enum tls_model model, 
> bool for_mov)
>              rtx rax = gen_rtx_REG (Pmode, AX_REG), insns, eqv;
>
>              start_sequence ();
> -             emit_call_insn (gen_tls_local_dynamic_base_64 (rax, caddr));
> +             if (Pmode == DImode)
> +               emit_call_insn (gen_tls_local_dynamic_base_64_di (rax,
> +                                                                 caddr));
> +             else
> +               emit_call_insn (gen_tls_local_dynamic_base_64_si (rax,
> +                                                                 caddr));
>              insns = get_insns ();
>              end_sequence ();

Please use indirect functions here, see many examples in the code.

OK with this change.

Thanks,
Uros.


Re: [Patch, Fortran] PR 52542 - Fix PROCEDURE() with Bind(C)

2012-03-12 Thread Paul Richard Thomas
Dear Tobias,

Apart from s/Contribute/Contributed/ this is OK for trunk.  In fact, I
would say that it is "obvious".

Thanks for the patch.

Paul

On Sat, Mar 10, 2012 at 4:53 PM, Tobias Burnus  wrote:
> Tobias Burnus wrote:
>>
>> If the interface in a PROCEDURE() statement is Bind(C), also the procedure
>> (pointer) declared in that statement is BIND(C).
>>
>> From the F2008 standard: "A proc-language-binding-spec without a NAME= is
>> allowed, but is redundant with the proc-interface required by C1222."
>>
>> Build and currently regtested on x86-64-linux.
>> OK for the trunk (if regtesting succeeded)?
>
>
> Well, it didn't as I forgot to reset two variables - one then gets then an
> error that one has specified an binding name - or the wrong binding name
> might be used.
>
> Build and regtested on x86-64-linux.
> OK?
>
> Tobias



-- 
The knack of flying is learning how to throw yourself at the ground and miss.
       --Hitchhikers Guide to the Galaxy


Re: [VMS/committed]: Do not define __size_t on VMS

2012-03-12 Thread Tristan Gingold

On Mar 9, 2012, at 6:22 PM, Joseph S. Myers wrote:

> On Fri, 9 Mar 2012, Tristan Gingold wrote:
> 
>> as it is already defined and used by the system headers.
>> 
>> No regressions for x86_64-darwin after full bootstrap.
>> 
>> Tristan.
>> 
>> 2012-03-09  Tristan Gingold  
>> 
>>  * ginclude/stddef.h: Do not define __size_t on VMS.
> 
> Sorry, this patch is wrong.  The identifier "VMS" is in the user's 
> namespace and users on non-VMS platforms must be able to define it as a 
> macro without affecting how stddef.h behaves.  Please change this to test 
> a macro in the implementation namespace instead.

Thank you for catching that.  Fixed with:

2012-03-12  Tristan Gingold  

* ginclude/stddef.h: Adjust previous patch.  Use __VMS__ instead
of VMS.


Index: gcc/ginclude/stddef.h
===
--- gcc/ginclude/stddef.h   (revision 185212)
+++ gcc/ginclude/stddef.h   (working copy)
@@ -203,7 +203,7 @@
 #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
   || defined(__FreeBSD_kernel__)
 /* __size_t is a typedef on FreeBSD 5, must not trash it. */
-#elif defined (VMS)
+#elif defined (__VMS__)
 /* __size_t is also a typedef on VMS.  */
 #else
 #define __size_t



[PATCH, i386]: Avoid partial reg stall with arith insn + setCC + movzbl sequence

2012-03-12 Thread Uros Bizjak
Hello!

Attached patch improves setCC + movzbl to xor + setcc peephole2 to
also handle CC setting arithmetic instructions.

2012-03-12  Uros Bizjak  

* config/i386/i386.md (setcc + movzbl to xor + setcc peephole2):
Also convert sequences with CC setting arithmetic instruction.

Tested on x86_64-pc-linux-gnu {, -m32}, committed to mainline SVN.

Uros.
Index: i386.md
===
--- i386.md (revision 185201)
+++ i386.md (working copy)
@@ -11170,6 +11170,27 @@
   ix86_expand_clear (operands[3]);
 })
 
+(define_peephole2
+  [(parallel [(set (reg FLAGS_REG) (match_operand 0 "" ""))
+ (match_operand 4 "" "")])
+   (set (match_operand:QI 1 "register_operand" "")
+   (match_operator:QI 2 "ix86_comparison_operator"
+ [(reg FLAGS_REG) (const_int 0)]))
+   (set (match_operand 3 "q_regs_operand" "")
+   (zero_extend (match_dup 1)))]
+  "(peep2_reg_dead_p (3, operands[1])
+|| operands_match_p (operands[1], operands[3]))
+   && ! reg_overlap_mentioned_p (operands[3], operands[0])"
+  [(parallel [(set (match_dup 5) (match_dup 0))
+ (match_dup 4)])
+   (set (strict_low_part (match_dup 6))
+   (match_dup 2))]
+{
+  operands[5] = gen_rtx_REG (GET_MODE (operands[0]), FLAGS_REG);
+  operands[6] = gen_lowpart (QImode, operands[3]);
+  ix86_expand_clear (operands[3]);
+})
+
 ;; Similar, but match zero extend with andsi3.
 
 (define_peephole2
@@ -11190,6 +11211,28 @@
   operands[5] = gen_lowpart (QImode, operands[3]);
   ix86_expand_clear (operands[3]);
 })
+
+(define_peephole2
+  [(parallel [(set (reg FLAGS_REG) (match_operand 0 "" ""))
+ (match_operand 4 "" "")])
+   (set (match_operand:QI 1 "register_operand" "")
+   (match_operator:QI 2 "ix86_comparison_operator"
+ [(reg FLAGS_REG) (const_int 0)]))
+   (parallel [(set (match_operand 3 "q_regs_operand" "")
+  (zero_extend (match_dup 1)))
+ (clobber (reg:CC FLAGS_REG))])]
+  "(peep2_reg_dead_p (3, operands[1])
+|| operands_match_p (operands[1], operands[3]))
+   && ! reg_overlap_mentioned_p (operands[3], operands[0])"
+  [(parallel [(set (match_dup 5) (match_dup 0))
+ (match_dup 4)])
+   (set (strict_low_part (match_dup 6))
+   (match_dup 2))]
+{
+  operands[5] = gen_rtx_REG (GET_MODE (operands[0]), FLAGS_REG);
+  operands[6] = gen_lowpart (QImode, operands[3]);
+  ix86_expand_clear (operands[3]);
+})
 
 ;; Call instructions.
 


Re: [PATCH] Move strip_float_extensions to tree.c

2012-03-12 Thread Richard Guenther
On Wed, 7 Mar 2012, Joseph S. Myers wrote:

> On Wed, 7 Mar 2012, Richard Guenther wrote:
> 
> > Now, convert.c is used from all frontends to implement convert ()
> > (that looks backwards - the language convert should be a langhook,
> > called from convert implemented in convert.c).  But well, I aint
> > not touching this beast ;)
> 
> I don't think convert () should be a langhook; it's all about 
> language-specific semantics (the only non-front-end places calling it, 
> outside of convert.c itself, now appear to be in arm.c).
>
> I'm not sure of the extent to which the recursive calls to convert inside 
> convert.c need any language-specific semantics.  To the extent that they 
> do, I think front ends should be dealing with the semantics rather than 
> having convert call back into the front end.  (I also think all the errors 
> from convert.c should be given by front ends instead; front ends should 
> only call the convert_to_* helpers for code they have checked is valid.)

I was thinking about having convert () be a middle-end function
(not langhook) working on generic, that does all frontend specific
stuff via a langhook (I didn't try to compare the convert implementations
to see if there is even any language-specifics about them).

I agree that errors should be raised from the frontends (also the
remaining optimizations convert_to_* do should be either moved to
fold or to later gimple optimization passes).

But no, I'm not going to touch this - maybe apart from removing
the obvious wrong users in arm.c.

Richard.


Re: [PATCH] Fix PRs 52080, 52097 and 48124, rewrite bitfield expansion, enable the C++ memory model wrt bitfields everywhere

2012-03-12 Thread Richard Guenther
On Fri, 9 Mar 2012, Eric Botcazou wrote:

> > This patch also completely replaces get_bit_range (which is where
> > PR52097 ICEs) by a trivial implementation.
> 
> How does it short-circuit the decision made by get_best_mode exactly?  By 
> making get_bit_range return non-zero in more cases?

It will make get_bit_range return non-zero in all cases (well, in
all cases where there is a COMPONENT_REF with a FIELD_DECL that
was part of a RECORD_TYPE at the time of finish_record_layout)

> > There is PR52134 which will make this patch cause 1 gnat regression.
> 
> This looks rather benign to me.

Yeah, it should be easy to fix - the question is whether we can
really rely on TYPE_SIZE_UNIT (DECL_CONTEXT (field)) - DECL_FIELD_OFFSET 
(field) to fold to a constant if field is the first field of a bitfield
group.  We can as well easily avoid the ICE by not computing a
DECL_BIT_FIELD_REPRESENTATIVE for such field in some way.
In the end how we divide bitfield groups will probably get some
control via a langhook.

> > * gimplify.c (gimplify_expr): Translate bitfield accesses
> > to BIT_FIELD_REFs of the representative.
> 
> This part isn't in the patch.

Oops.  And it should not be (I did that for experimentation), ChangeLog
piece dropped.

> > + /* Return a new underlying object for a bitfield started with FIELD.  */
> > +
> > + static tree
> > + start_bitfield_representative (tree field)
> > + {
> > +   tree repr = make_node (FIELD_DECL);
> > +   DECL_FIELD_OFFSET (repr) = DECL_FIELD_OFFSET (field);
> > +   /* Force the representative to begin at an BITS_PER_UNIT aligned
> 
> ...at a BITS_PER_UNIT aligned...

Fixed.

> > +  boundary - C++ may use tail-padding of a base object to
> > +  continue packing bits so the bitfield region does not start
> > +  at bit zero (see g++.dg/abi/bitfield5.C for example).
> > +  Unallocated bits may happen for other reasons as well,
> > +  for example Ada which allows explicit bit-granular structure layout.
> >  */ +   DECL_FIELD_BIT_OFFSET (repr)
> > + = size_binop (BIT_AND_EXPR,
> > + DECL_FIELD_BIT_OFFSET (field),
> > + bitsize_int (~(BITS_PER_UNIT - 1)));
> > +   SET_DECL_OFFSET_ALIGN (repr, DECL_OFFSET_ALIGN (field));
> > +   DECL_SIZE (repr) = DECL_SIZE (field);
> > +   DECL_PACKED (repr) = DECL_PACKED (field);
> > +   DECL_CONTEXT (repr) = DECL_CONTEXT (field);
> > +   return repr;
> 
> Any particular reason to set DECL_SIZE but not DECL_SIZE_UNIT here?  They are 
> generally set together.

No reason, fixed (I just set those fields I will use during updating
of 'repr', the other fields are set once the field has final size).

> > +
> > + /* Finish up a bitfield group that was started by creating the underlying
> > +object REPR with the last fied in the bitfield group FIELD.  */
> 
> ...the last field...

Fixed.

> > +   /* Round up bitsize to multiples of BITS_PER_UNIT.  */
> > +   bitsize = (bitsize + BITS_PER_UNIT - 1) & ~(BITS_PER_UNIT - 1);
> > +
> > +   /* Find the smallest nice mode to use.
> > +  ???  Possibly use get_best_mode with appropriate arguments instead
> > +  (which would eventually require splitting representatives here).  */
> > +   for (modesize = bitsize; modesize <= maxbitsize; modesize +=
> > BITS_PER_UNIT) + {
> > +   mode = mode_for_size (modesize, MODE_INT, 1);
> > +   if (mode != BLKmode)
> > +   break;
> > + }
> 
> The double loop looks superfluous.  Why not re-using the implementation of 
> smallest_mode_for_size?

Ah, indeed.  Matching the current implementation would be

>   for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); mode != VOIDmode;
>mode = GET_MODE_WIDER_MODE (mode))
> if (GET_MODE_PRECISION (mode) >= bitsize)
>   break;
> 
>   if (mode != VOIDmode
&& (GET_MODE_PRECISION (mode) > maxbitsize
|| GET_MODE_PRECISION (mode) > MAX_FIXED_MODE_SIZE))
> mode = VOIDmode;
> 
>   if (mode == VOIDmode)
> ...

Btw, I _think_ I want GET_MODE_BITSIZE here - we cannot allow
GET_MODE_BITSIZE > GET_MODE_PRECISION as that would possibly
access memory that is not allowed.  Thus, what GET_MODE_* would
identify the access size used for a MEM of that mode?

Anyway, fixed as you suggested, with the MAX_FIXED_MODE_SIZE check.

I'll split out the tree-sra.c piece, re-test and re-post.

Thanks,
Richard.


Re: [PATCH] Fix up register_edge_assert_for_2 (PR tree-optimization/52533)

2012-03-12 Thread Richard Guenther
On Fri, 9 Mar 2012, Jakub Jelinek wrote:

> Hi!
> 
> My recent commit to tree-vrp.c on the trunk caused the following
> testcase to fail, the problem is that we would insert <= 255
> assertion for unsigned char expression (which doesn't say anything)
> and VRP insist that such ASSERT_EXPRs aren't added.
> 
> Fixed thusly, in addition the patch cleans the code slightly,
> e.g. by using double_int instead of a pair of uHWIs.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux,
> ok for trunk?

Ok.

Thanks,
Richard.

> 2012-03-09  Jakub Jelinek  
> 
>   PR tree-optimization/52533
>   * tree-vrp.c (register_edge_assert_for_2): Use double_int
>   type for mask, only handle shifts by non-zero in-range
>   shift count, for LE_EXPR and GT_EXPR if new_val is
>   maximum, don't add the assertion.
> 
>   * gcc.c-torture/compile/pr52533.c: New test.
> 
> --- gcc/tree-vrp.c.jj 2012-03-09 10:26:26.0 +0100
> +++ gcc/tree-vrp.c2012-03-09 12:30:19.348501480 +0100
> @@ -4470,7 +4470,8 @@ register_edge_assert_for_2 (tree name, e
>gimple def_stmt = SSA_NAME_DEF_STMT (name);
>tree name2 = NULL_TREE, cst2 = NULL_TREE;
>tree val2 = NULL_TREE;
> -  unsigned HOST_WIDE_INT mask[2] = { 0, 0 };
> +  double_int mask = double_int_zero;
> +  unsigned int prec = TYPE_PRECISION (TREE_TYPE (val));
>  
>/* Extract CST2 from the right shift.  */
>if (is_gimple_assign (def_stmt)
> @@ -4480,23 +4481,13 @@ register_edge_assert_for_2 (tree name, e
> cst2 = gimple_assign_rhs2 (def_stmt);
> if (TREE_CODE (name2) == SSA_NAME
> && host_integerp (cst2, 1)
> -   && (unsigned HOST_WIDE_INT) tree_low_cst (cst2, 1)
> -  < 2 * HOST_BITS_PER_WIDE_INT
> && INTEGRAL_TYPE_P (TREE_TYPE (name2))
> +   && IN_RANGE (tree_low_cst (cst2, 1), 1, prec - 1)
> +   && prec <= 2 * HOST_BITS_PER_WIDE_INT
> && live_on_edge (e, name2)
> && !has_single_use (name2))
>   {
> -   if ((unsigned HOST_WIDE_INT) tree_low_cst (cst2, 1)
> -   < HOST_BITS_PER_WIDE_INT)
> - mask[0] = ((unsigned HOST_WIDE_INT) 1
> -<< tree_low_cst (cst2, 1)) - 1;
> -   else
> - {
> -   mask[1] = ((unsigned HOST_WIDE_INT) 1
> -  << (tree_low_cst (cst2, 1)
> -  - HOST_BITS_PER_WIDE_INT)) - 1;
> -   mask[0] = -1;
> - }
> +   mask = double_int_mask (tree_low_cst (cst2, 1));
> val2 = fold_binary (LSHIFT_EXPR, TREE_TYPE (val), val, cst2);
>   }
>   }
> @@ -4515,37 +4506,40 @@ register_edge_assert_for_2 (tree name, e
>   {
> if (!TYPE_UNSIGNED (TREE_TYPE (val)))
>   {
> -   unsigned int prec = TYPE_PRECISION (TREE_TYPE (val));
> tree type = build_nonstandard_integer_type (prec, 1);
> tmp = build1 (NOP_EXPR, type, name2);
> val2 = fold_convert (type, val2);
>   }
> tmp = fold_build2 (MINUS_EXPR, TREE_TYPE (tmp), tmp, val2);
> -   new_val = build_int_cst_wide (TREE_TYPE (tmp), mask[0], mask[1]);
> +   new_val = double_int_to_tree (TREE_TYPE (tmp), mask);
> new_comp_code = comp_code == EQ_EXPR ? LE_EXPR : GT_EXPR;
>   }
> else if (comp_code == LT_EXPR || comp_code == GE_EXPR)
>   new_val = val2;
> else
>   {
> -   new_val = build_int_cst_wide (TREE_TYPE (val2),
> - mask[0], mask[1]);
> -   new_val = fold_binary (BIT_IOR_EXPR, TREE_TYPE (val2),
> -  val2, new_val);
> +   mask = double_int_ior (tree_to_double_int (val2), mask);
> +   if (double_int_minus_one_p (double_int_sext (mask, prec)))
> + new_val = NULL_TREE;
> +   else
> + new_val = double_int_to_tree (TREE_TYPE (val2), mask);
>   }
>  
> -   if (dump_file)
> +   if (new_val)
>   {
> -   fprintf (dump_file, "Adding assert for ");
> -   print_generic_expr (dump_file, name2, 0);
> -   fprintf (dump_file, " from ");
> -   print_generic_expr (dump_file, tmp, 0);
> -   fprintf (dump_file, "\n");
> - }
> +   if (dump_file)
> + {
> +   fprintf (dump_file, "Adding assert for ");
> +   print_generic_expr (dump_file, name2, 0);
> +   fprintf (dump_file, " from ");
> +   print_generic_expr (dump_file, tmp, 0);
> +   fprintf (dump_file, "\n");
> + }
>  
> -   register_new_assert_for (name2, tmp, new_comp_code, new_val,
> -NULL, e, bsi);
> -   retval = true;
> +   register_new_assert_for (name2, tmp, new_comp_code, new_val,
> +  

Re: [committed] Fix failure of gcc.dg/torture/pr52407.c on hppa*-*-hpux*

2012-03-12 Thread Richard Guenther
On Sat, 10 Mar 2012, John David Anglin wrote:

> Work around limited alignment of common.
> 
> Tested on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11.  Committed to trunk.
> 
> Ok for 4.7?

Ok.

Thanks,
Richard.


[Patch]: Add include hacks for VMS headers

2012-03-12 Thread Tristan Gingold
Hi,

this patch adds a few fix include entries for VMS so that:
* it is possible to use a gcc for VMS to compile gcc (collisions between system 
and gcc headers),
* no warnings when signal.h is included,
* no warnings when resolv.h is included,
* avoid the use of DEC-C built-ins in some standard macros,
* disable getopt/optinf/opterr/optopt in 64 bit modes,
* declare some structure tag outside of argument list,
* use the more portable version of setjmp.

Tested for a while to build gcc for ia64 and alpha VMS.
'make check' is clean.

Comments are welcome!

Ok for trunk ?

Tristan.

fixincludes/
2012-03-12  Tristan Gingold  

* inclhack.def (vms_use_quoted_include,vms_add_missing_braces)
(vms_do_not_redeclare_hostalias, vms_decc_builtin)
(vms_no_64bit_getopt, vms_forward_declare_struct)
(vms_use_fast_setjmp): New fixes.
* fixincl.x: Regenerate.
* tests/base/rtldef/string.h: Update.
* tests/base/rtldef/if.h, tests/base/rtldef/resolv.h,
* tests/base/rtldef/setjmp.h, tests/base/rtldef/signal.h,
* tests/base/rtldef/stdio.h, tests/base/rtldef/wait.h: New files.

diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 40e7805..1a5cd8d 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -4611,6 +4611,129 @@ fix = {
 };
 
 /*
+ * On VMS, change  to  to avoid a
+ * conflict while building gcc.  Likewise for 
+ */
+fix = {
+hackname  = vms_use_quoted_include;
+select= "(#[ \t]*include[ \t]+)<(resource|builtins)\\.h>";
+mach  = "*-*-*vms*";
+files = rtldef/wait.h, starlet_c/pthread.h;
+c_fix = format;
+
+c_fix_arg = '%1';
+
+test_text = "#   include ";
+};
+
+/*
+ * On VMS, add missing braces around sigset_t constants.
+ */
+fix = {
+hackname  = vms_add_missing_braces;
+select= "(_SIG_[A-Z]+_SET[ \t]+= \\{)(0x[0F]+, 0x[0F]+)";
+mach  = "*-*-*vms*";
+files = "rtldef/signal.h";
+c_fix = format;
+
+c_fix_arg = '%1 {%2} ';
+
+test_text = "static const __sigset_t _SIG_EMPTY_SET  = "
+"{0x, 0x},\n"
+" _SIG_FULL_SET   = {0x, 0x};\n";
+};
+
+/*
+ * On VMS, fix incompatible redeclaration of hostalias.
+ */
+fix = {
+hackname  = vms_do_not_redeclare_hostalias;
+select= "(void[ \t]+fp_nquery \\(const u_char \\*, int, FILE 
\\*\\);)\n"
+"(__char_ptr32[ \t]+hostalias \\(const char \\*\\);)";
+mach  = "*-*-*vms*";
+files = "rtldef/resolv.h";
+c_fix = format;
+
+c_fix_arg = "%1\n"
+"/* %2 */";
+
+test_text = "void  fp_nquery (const u_char *, int, FILE *);\n"
+"__char_ptr32  hostalias (const char *);\n";
+};
+
+/*
+ * On VMS, some DEC-C builtins are directly used.
+ */
+fix = {
+hackname  = vms_decc_builtin;
+select= "(__MEMSET|__MEMMOVE|__MEMCPY|__STRLEN|__STRCPY)";
+mach  = "*-*-*vms*";
+files = rtldef/string.h, rtldef/time.h, rtldef/strings.h,
+rtldef/socket.h;
+sed   = "s@__MEMSET@memset@";
+sed   = "s@__MEMMOVE@memmove@";
+sed   = "s@__MEMCPY@memcpy@";
+sed   = "s@__STRLEN@strlen@";
+sed   = "s@__STRCPY@strcpy@";
+
+test_text = "define FD_ZERO(__p) __MEMSET((__p), 0, sizeof(*(__p)))\n";
+};
+
+/*
+ * On VMS, do not declare getopt and al if pointers are 64 bit.
+ */
+fix = {
+hackname  = vms_no_64bit_getopt;
+select= "^[ \t]*(extern[ \t]*)?(int[ 
\t]*(getopt|optind|opterr|optopt)|(char \\*optarg))([ \t]*\\(.*\\))?;\n";
+/*select= "^[ \t](extern[ \t))?(int[ 
\t](getopt|optind|opterr|optopt))|(char *optarg).*;\n"; */
+mach  = "*-*-*vms*";
+files = rtldef/stdio.h, rtldef/unistd.h;
+c_fix = format;
+
+c_fix_arg = "#if __INITIAL_POINTER_SIZE != 64 /* getopt is short ptr only. 
 */\n"
+"%0"
+"#endif\n";
+
+test_text = "int getopt (int, char * const [], const char *);";
+};
+
+/*
+ * On VMS, forward declare structure before referencing them in prototypes.
+ */
+fix = {
+hackname  = vms_forward_declare_struct;
+select= "(/\\* forward decls for C\\+\\+ \\*/\n)"
+"#ifdef __cplusplus\n";
+mach  = "*-*-*vms*";
+files = rtldef/if.h;
+c_fix = format;
+
+c_fix_arg = "%1"
+"#if defined (__cplusplus) || defined (__GNUC__)\n";
+
+test_text = "/* forward decls for C++ */\n"
+"#ifdef __cplusplus\n"
+"struct foo;\n"
+"#endif\n";
+};
+
+/*
+ * On VMS, force the use of fast setjmp, as the normal setjmp uses conditions
+ * which is not yet fully supported by gcc.
+ */
+fix = {
+hackname  = vms_use_fast_setjmp;
+select= "(#[ \t]*if[ \t]*defined\\(__FAST_SETJMP\\)[ \t]*\\|\\|)";
+mach  = "*-*-*vms*";
+files = rtldef/setjmp.h;
+c_fix = format;
+
+c_fix_arg = "%0 defined (

Re: [PATCH, i386]: Avoid partial reg stall with arith insn + setCC + movzbl sequence

2012-03-12 Thread Paolo Bonzini
Il 12/03/2012 09:52, Uros Bizjak ha scritto:
> +(define_peephole2
> +  [(parallel [(set (reg FLAGS_REG) (match_operand 0 "" ""))
> +   (match_operand 4 "" "")])
> +   (set (match_operand:QI 1 "register_operand" "")
> + (match_operator:QI 2 "ix86_comparison_operator"
> +   [(reg FLAGS_REG) (const_int 0)]))
> +   (set (match_operand 3 "q_regs_operand" "")
> + (zero_extend (match_dup 1)))]
> +  "(peep2_reg_dead_p (3, operands[1])
> +|| operands_match_p (operands[1], operands[3]))
> +   && ! reg_overlap_mentioned_p (operands[3], operands[0])"

I understand that you're assuming the shape of operands[4] to be the
same as operands[3], but would it be preferrable to add another overlap
check on operands[4]?

For example the transformation is invalid if you had an overlap between
operands[3] and the destination of operands[4].

Paolo


Re: [PATCH] Fix PRs 52080, 52097 and 48124, rewrite bitfield expansion, enable the C++ memory model wrt bitfields everywhere

2012-03-12 Thread Eric Botcazou
> Btw, I _think_ I want GET_MODE_BITSIZE here - we cannot allow
> GET_MODE_BITSIZE > GET_MODE_PRECISION as that would possibly
> access memory that is not allowed.  Thus, what GET_MODE_* would
> identify the access size used for a MEM of that mode?

I agree that GET_MODE_BITSIZE makes more sense than GET_MODE_PRECISION here.

-- 
Eric Botcazou


Re: [PATCH] Do not handle SUBREG in apply_distributive_law (Re: RFC: allowing fwprop to propagate subregs)

2012-03-12 Thread Richard Guenther
On Wed, Mar 7, 2012 at 6:40 PM, Ulrich Weigand  wrote:
> Richard Kenner wrote:
>
>> > Given the current set of results, since I do not have any way to verify
>> > whether my simplify_set changes would actually trigger correctly, I'd
>> > rather propose to just remove the SUBREG case in apply_distributive_law
>> > (i.e. only apply the first patch below).
>> >
>> > Thoughts?
>>
>> I think that's reasonable.  But I'd replace it with a comment saying
>> what used to be there and why it was removed.
>
> Now that we're back in stage 1, I'd like to try and move forward with
> this again.  Here's a patch that implements your suggestion.
>
> Tested on arm-linux-gnueabi, i386-linux-gnu and s390-linux-gnu.
>
> OK for mainline?

Ok.

Thanks,
Richard.

> Bye,
> Ulrich
>
> 2012-03-07  Ulrich Weigand  
>
>        gcc/
>        * combine.c (apply_distributive_law): Do not distribute SUBREG.
>
> === modified file 'gcc/combine.c'
> --- gcc/combine.c       2012-02-07 15:48:52 +
> +++ gcc/combine.c       2012-02-22 11:57:19 +
> @@ -9286,36 +9286,22 @@
>       /* This is also a multiply, so it distributes over everything.  */
>       break;
>
> -    case SUBREG:
> -      /* Non-paradoxical SUBREGs distributes over all operations,
> -        provided the inner modes and byte offsets are the same, this
> -        is an extraction of a low-order part, we don't convert an fp
> -        operation to int or vice versa, this is not a vector mode,
> -        and we would not be converting a single-word operation into a
> -        multi-word operation.  The latter test is not required, but
> -        it prevents generating unneeded multi-word operations.  Some
> -        of the previous tests are redundant given the latter test,
> -        but are retained because they are required for correctness.
> -
> -        We produce the result slightly differently in this case.  */
> -
> -      if (GET_MODE (SUBREG_REG (lhs)) != GET_MODE (SUBREG_REG (rhs))
> -         || SUBREG_BYTE (lhs) != SUBREG_BYTE (rhs)
> -         || ! subreg_lowpart_p (lhs)
> -         || (GET_MODE_CLASS (GET_MODE (lhs))
> -             != GET_MODE_CLASS (GET_MODE (SUBREG_REG (lhs
> -         || paradoxical_subreg_p (lhs)
> -         || VECTOR_MODE_P (GET_MODE (lhs))
> -         || GET_MODE_SIZE (GET_MODE (SUBREG_REG (lhs))) > UNITS_PER_WORD
> -         /* Result might need to be truncated.  Don't change mode if
> -            explicit truncation is needed.  */
> -         || !TRULY_NOOP_TRUNCATION_MODES_P (GET_MODE (x),
> -                                            GET_MODE (SUBREG_REG (lhs
> -       return x;
> -
> -      tem = simplify_gen_binary (code, GET_MODE (SUBREG_REG (lhs)),
> -                                SUBREG_REG (lhs), SUBREG_REG (rhs));
> -      return gen_lowpart (GET_MODE (x), tem);
> +    /* This used to handle SUBREG, but this turned out to be counter-
> +       productive, since (subreg (op ...)) usually is not handled by
> +       insn patterns, and this "optimization" therefore transformed
> +       recognizable patterns into unrecognizable ones.  Therefore the
> +       SUBREG case was removed from here.
> +
> +       It is possible that distributing SUBREG over arithmetic operations
> +       leads to an intermediate result than can then be optimized further,
> +       e.g. by moving the outer SUBREG to the other side of a SET as done
> +       in simplify_set.  This seems to have been the original intent of
> +       handling SUBREGs here.
> +
> +       However, with current GCC this does not appear to actually happen,
> +       at least on major platforms.  If some case is found where removing
> +       the SUBREG case here prevents follow-on optimizations, distributing
> +       SUBREGs ought to be re-added at that place, e.g. in simplify_set.  */
>
>     default:
>       return x;
>
>
>
> --
>  Dr. Ulrich Weigand
>  GNU Toolchain for Linux on System z and Cell BE
>  ulrich.weig...@de.ibm.com
>


[PATCH][ARM] Do not call covert during RTL expansion

2012-03-12 Thread Richard Guenther

convert is supposed to be called only from frontend code as it
may raise errors.

The call in neon_dereference_pointer is from RTL expansion
(and not necessary).

Fixed as follows, I built a cross-cc1 for checking.

Ok?

Thanks,
Richard.

2012-03-12  Richard Guenther  

* config/arm/arm.c (neon_dereference_pointer): Do not call
covert during RTL expansion.

Index: gcc/config/arm/arm.c
===
*** gcc/config/arm/arm.c(revision 185220)
--- gcc/config/arm/arm.c(working copy)
*** neon_dereference_pointer (tree exp, enum
*** 20637,20645 
array_type = build_array_type (elem_type, build_index_type (upper_bound));
  
/* Dereference EXP using that type.  */
-   exp = convert (build_pointer_type (array_type), exp);
return fold_build2 (MEM_REF, array_type, exp,
! build_int_cst (TREE_TYPE (exp), 0));
  }
  
  /* Expand a Neon builtin.  */
--- 20637,20644 
array_type = build_array_type (elem_type, build_index_type (upper_bound));
  
/* Dereference EXP using that type.  */
return fold_build2 (MEM_REF, array_type, exp,
! build_int_cst (build_pointer_type (array_type), 0));
  }
  
  /* Expand a Neon builtin.  */


[PATCH] Fix some SRA and GIMPLE verification issues

2012-03-12 Thread Richard Guenther

This fixes issues I noticed when working on the bitfield expansion
issues.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2012-03-05  Richard Guenther  

* tree-sra.c (create_access_replacement): Only rename the
replacement if we can rewrite it into SSA form.  Properly
mark register typed replacements that we cannot rewrite
with TREE_ADDRESSABLE.
* tree-cfg.c (verify_expr): Fix BIT_FIELD_REF verification
for aggregate or BLKmode results.

Index: gcc/tree-sra.c
===
*** gcc/tree-sra.c.orig 2012-02-21 12:59:35.0 +0100
--- gcc/tree-sra.c  2012-02-24 12:52:39.0 +0100
*** create_access_replacement (struct access
*** 1922,1934 
  
repl = create_tmp_var (access->type, "SR");
add_referenced_var (repl);
!   if (rename)
  mark_sym_for_renaming (repl);
  
!   if (!access->grp_partial_lhs
!   && (TREE_CODE (access->type) == COMPLEX_TYPE
! || TREE_CODE (access->type) == VECTOR_TYPE))
! DECL_GIMPLE_REG_P (repl) = 1;
  
DECL_SOURCE_LOCATION (repl) = DECL_SOURCE_LOCATION (access->base);
DECL_ARTIFICIAL (repl) = 1;
--- 1922,1940 
  
repl = create_tmp_var (access->type, "SR");
add_referenced_var (repl);
!   if (!access->grp_partial_lhs
!   && rename)
  mark_sym_for_renaming (repl);
  
!   if (TREE_CODE (access->type) == COMPLEX_TYPE
!   || TREE_CODE (access->type) == VECTOR_TYPE)
! {
!   if (!access->grp_partial_lhs)
!   DECL_GIMPLE_REG_P (repl) = 1;
! }
!   else if (access->grp_partial_lhs
!  && is_gimple_reg_type (access->type))
! TREE_ADDRESSABLE (repl) = 1;
  
DECL_SOURCE_LOCATION (repl) = DECL_SOURCE_LOCATION (access->base);
DECL_ARTIFICIAL (repl) = 1;
Index: gcc/tree-cfg.c
===
*** gcc/tree-cfg.c.orig 2012-02-24 12:29:18.0 +0100
--- gcc/tree-cfg.c  2012-02-24 12:52:39.0 +0100
*** verify_expr (tree *tp, int *walk_subtree
*** 2879,2895 
  error ("invalid position or size operand to BIT_FIELD_REF");
  return t;
}
! else if (INTEGRAL_TYPE_P (TREE_TYPE (t))
!  && (TYPE_PRECISION (TREE_TYPE (t))
!  != TREE_INT_CST_LOW (TREE_OPERAND (t, 1
{
  error ("integral result type precision does not match "
 "field size of BIT_FIELD_REF");
  return t;
}
! if (!INTEGRAL_TYPE_P (TREE_TYPE (t))
! && (GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (t)))
! != TREE_INT_CST_LOW (TREE_OPERAND (t, 1
{
  error ("mode precision of non-integral result does not "
 "match field size of BIT_FIELD_REF");
--- 2879,2897 
  error ("invalid position or size operand to BIT_FIELD_REF");
  return t;
}
! if (INTEGRAL_TYPE_P (TREE_TYPE (t))
! && (TYPE_PRECISION (TREE_TYPE (t))
! != TREE_INT_CST_LOW (TREE_OPERAND (t, 1
{
  error ("integral result type precision does not match "
 "field size of BIT_FIELD_REF");
  return t;
}
! else if (!INTEGRAL_TYPE_P (TREE_TYPE (t))
!  && !AGGREGATE_TYPE_P (TREE_TYPE (t))
!  && TYPE_MODE (TREE_TYPE (t)) != BLKmode
!  && (GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (t)))
!  != TREE_INT_CST_LOW (TREE_OPERAND (t, 1
{
  error ("mode precision of non-integral result does not "
 "match field size of BIT_FIELD_REF");



Re: [PATCH] Improve SCEV for array element

2012-03-12 Thread Richard Guenther
On Thu, Mar 8, 2012 at 8:13 AM, Jiangning Liu  wrote:
>
>
>> -Original Message-
>> From: Richard Guenther [mailto:richard.guent...@gmail.com]
>> Sent: Tuesday, March 06, 2012 9:12 PM
>> To: Jiangning Liu
>> Cc: gcc-patches@gcc.gnu.org
>> Subject: Re: [PATCH] Improve SCEV for array element
>>
>> On Fri, Jan 20, 2012 at 10:06 AM, Jiangning Liu 
>> wrote:
>> >> It's definitely not ok at this stage but at most for next stage1.
>> >
>> > OK. I may wait until next stage1.
>> >
>> >> This is a very narrow pattern-match.  It doesn't allow for &a[i].x
>> for
>> >> example,
>> >> even if a[i] is a one-element structure.  I think the canonical way
>> of
>> >> handling
>> >> ADDR_EXPR is to use sth like
>> >>
>> >> base = get_inner_reference (TREE_OPERAND (rhs1, 0), ...,
>> &offset,  ...);
>> >> base = build1 (ADDR_EXPR, TREE_TYPE (rhs1), base);
>> >>         chrec1 = analyze_scalar_evolution (loop, base);
>> >>         chrec2 = analyze_scalar_evolution (loop, offset);
>> >>         chrec1 = chrec_convert (type, chrec1, at_stmt);
>> >>         chrec2 = chrec_convert (TREE_TYPE (offset), chrec2, at_stmt);
>> >>         res = chrec_fold_plus (type, chrec1, chrec2);
>> >>
>> >> where you probably need to handle scev_not_known when analyzing
>> offset
>> >> (which might be NULL).  You also need to add bitpos to the base
>> address
>> >> (in bytes, of course).  Note that the &MEM_REF case would naturally
>> >> work
>> >> with this as well.
>> >
>> > OK. New patch is like below, and bootstrapped on x86-32.
>>
>> You want instead of
>>
>> +      if (TREE_CODE (TREE_OPERAND (rhs1, 0)) == ARRAY_REF
>> +          || TREE_CODE (TREE_OPERAND (rhs1, 0)) == MEM_REF
>> +          || TREE_CODE (TREE_OPERAND (rhs1, 0)) == COMPONENT_REF)
>> +        {
>>
>> if (TREE_CODE (TREE_OPERAND (rhs1, 0)) == MEM_REF
>>     || handled_component_p (TREE_OPERAND (rhs1, 0)))
>>   {
>>
>> +             base = build1 (ADDR_EXPR, TREE_TYPE (rhs1), base);
>> +             chrec1 = analyze_scalar_evolution (loop, base);
>>
>> can you please add a wrapper
>>
>> tree
>> analyze_scalar_evolution_for_address_of (struct loop *loop, tree var)
>> {
>>   return analyze_scalar_evolution (loop, build_fold_addr_expr (var));
>> }
>>
>> and call that instead of building the ADDR_EXPR there?  We want
>> to avoid building that tree node, but even such a simple wrapper would
>> be prefered.
>>
>> +         if (bitpos)
>>
>> if (bitpos != 0)
>>
>> +             chrec3 = build_int_cst (integer_type_node,
>> +                                     bitpos / BITS_PER_UNIT);
>>
>> please use size_int (bitpos / BITS_PER_UNIT) instead.  Using
>> integer_type_node is definitely wrong.
>>
>> Ok with that changes.
>>
>
> Richard,
>
> Modified as all you suggested, and new code is like below. Bootstrapped on
> x86-32. OK for trunk now?

Ok.

Thanks,
Richard.

> Thanks,
> -Jiangning
>
> ChangeLog:
>
> 2012-03-08  Jiangning Liu  
>
>        * tree-scalar-evolution (interpret_rhs_expr): generate chrec for
>        array reference and component reference.
>        (analyze_scalar_evolution_for_address_of): New.
>
> ChangeLog for testsuite:
>
> 2012-03-08  Jiangning Liu  
>
>        * gcc.dg/tree-ssa/scev-3.c: New.
>        * gcc.dg/tree-ssa/scev-4.c: New.
>
> diff --git a/gcc/testsuite/gcc.dg/tree-ssa/scev-3.c
> b/gcc/testsuite/gcc.dg/tree-ssa/scev-3.c
> new file mode 100644
> index 000..28d5c93
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/tree-ssa/scev-3.c
> @@ -0,0 +1,18 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -fdump-tree-optimized" } */
> +
> +int *a_p;
> +int a[1000];
> +
> +f(int k)
> +{
> +       int i;
> +
> +       for (i=k; i<1000; i+=k) {
> +               a_p = &a[i];
> +               *a_p = 100;
> +        }
> +}
> +
> +/* { dg-final { scan-tree-dump-times "&a" 1 "optimized" } } */
> +/* { dg-final { cleanup-tree-dump "optimized" } } */
> diff --git a/gcc/testsuite/gcc.dg/tree-ssa/scev-4.c
> b/gcc/testsuite/gcc.dg/tree-ssa/scev-4.c
> new file mode 100644
> index 000..6c1e530
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/tree-ssa/scev-4.c
> @@ -0,0 +1,23 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -fdump-tree-optimized" } */
> +
> +typedef struct {
> +       int x;
> +       int y;
> +} S;
> +
> +int *a_p;
> +S a[1000];
> +
> +f(int k)
> +{
> +       int i;
> +
> +       for (i=k; i<1000; i+=k) {
> +               a_p = &a[i].y;
> +               *a_p = 100;
> +        }
> +}
> +
> +/* { dg-final { scan-tree-dump-times "&a" 1 "optimized" } } */
> +/* { dg-final { cleanup-tree-dump "optimized" } } */
> diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
> index 2077c8d..c719984
> --- a/gcc/tree-scalar-evolution.c
> +++ b/gcc/tree-scalar-evolution.c
> @@ -266,6 +266,8 @@ along with GCC; see the file COPYING3.  If not see
>  #include "params.h"
>
>  static tree analyze_scalar_evolution_1 (struct loop *, tree, tree);
> +static tree analyze_scalar_evolution_for_address_of (struct loop *loop,
> +                             

Re: [PATCH, i386]: Avoid partial reg stall with arith insn + setCC + movzbl sequence

2012-03-12 Thread Uros Bizjak
On Mon, Mar 12, 2012 at 11:13 AM, Paolo Bonzini  wrote:
> Il 12/03/2012 09:52, Uros Bizjak ha scritto:
>> +(define_peephole2
>> +  [(parallel [(set (reg FLAGS_REG) (match_operand 0 "" ""))
>> +           (match_operand 4 "" "")])
>> +   (set (match_operand:QI 1 "register_operand" "")
>> +     (match_operator:QI 2 "ix86_comparison_operator"
>> +       [(reg FLAGS_REG) (const_int 0)]))
>> +   (set (match_operand 3 "q_regs_operand" "")
>> +     (zero_extend (match_dup 1)))]
>> +  "(peep2_reg_dead_p (3, operands[1])
>> +    || operands_match_p (operands[1], operands[3]))
>> +   && ! reg_overlap_mentioned_p (operands[3], operands[0])"
>
> I understand that you're assuming the shape of operands[4] to be the
> same as operands[3], but would it be preferrable to add another overlap
> check on operands[4]?
>
> For example the transformation is invalid if you had an overlap between
> operands[3] and the destination of operands[4].

The destination of operands[4] _always_ matches one of operands inside
operand[0]. All arithmetic insn that set flags are destructive on x86.

Uros.


Re: [PATCH] Proper use of decl_function_context in dwar2out.c

2012-03-12 Thread Richard Guenther
On Thu, Mar 8, 2012 at 12:18 PM, Jakub Jelinek  wrote:
> On Thu, Mar 08, 2012 at 12:06:46PM +0100, Martin Jambor wrote:
>>        /* For local statics lookup proper context die.  */
>> -      if (TREE_STATIC (decl) && decl_function_context (decl))
>> -     context_die = lookup_decl_die (DECL_CONTEXT (decl));
>> +      if (TREE_STATIC (decl) &&
>> +       (ctx_fndecl = decl_function_context (decl)) != NULL_TREE)
>> +     context_die = lookup_decl_die (ctx_fndecl);
>
> The formatting is wrong, && shouldn't be at the end of line.
> For the rest I'll defer to Jason, not sure what exactly we want to do there.
> This hunk has been added by Honza:

I don't think the patch is right.  Suppose you have a function-local
class declaration with a static member.  Surely the context DIE
you want to use is still the class one, not the function one.

So, I'm not sure why we should not be able to create a testcase
that fails even without LTO.  I think using get_context_die here
would be more appropriate.  Or restrict this to DECL_CONTEXT (decl)
== FUNCTION_DECL.

Richard.

> 2005-06-09  Jan Hubicka  
>
>        * cgraphunit.c (cgraph_create_edges): Do not walk BLOCK; finalize
>        local statics when doing unit-at-a-time.
>        (cgraph_varpool_assemble_pending_decls): Output debug info.
>        * dwarf2out.c (decls_for_scope): Skip local statics.
>        (dwarf2out_decl): Handle local statics.
>        * passes.c (rest_of_decl_compilation): Do not differentiate
>        local and global statics in unit-at-a-time.
>        * tree-inline.c (remap_decls): Put local static into
>        unexpanded_vars_list rather than introducing duplicated VAR_DECL
>        node.
>
>        Jakub


Re: [WIP PATCH] Re: Inefficient end-of-loop value computation - missed optimization somewhere?

2012-03-12 Thread Richard Guenther
On Thu, Mar 8, 2012 at 3:29 PM, Ulrich Weigand  wrote:
> Richard Guenther wrote:
>> On Tue, Feb 28, 2012 at 4:10 PM, Ulrich Weigand  wrote:
>> > I'll still need to do proper testing and benchmarking, but I thought
>> > I'd post the patch anyway just as a heads-up ...
>> >
>> > Does this look reasonable to you?
>>
>> Yes, that looks reasonable.  Though instead of unsigned_type_for
>> please use build_nonstandard_integer_type instead (if the type
>> is not already unsigned).  unsigned_type_for does not necessarily
>> preserve type-precision and may even return NULL.
>
> OK, I've changed the patch to use build_nonstandard_integer_type, and it
> still fixes the original problem.  However, on further examination it
> turns out that this "fix" is not because the expression is actually
> simplified at tree level.  Rather, it is just that because of some
> minor reassociation (the +1 is moved to the end), the *RTL* optimizers
> now see a (just as complex but) slightly different RTL sequence, and
> therefore combine now just happens to be able to fold everything
> together (using the RTL-level simplify_plus_minus machinery).
>
> Even worse, the patch causes a number of regressions:
>
>> FAIL: gcc.dg/tree-ssa/loop-15.c scan-tree-dump-times optimized "\\+" 0
>> FAIL: gcc.dg/tree-ssa/loop-15.c scan-tree-dump-times optimized "n_. \\* n_." 
>> 1
>> FAIL: gcc.dg/vect/no-scevccp-noreassoc-outer-4.c scan-tree-dump-times vect 
>> "OUTER LOOP VECTORIZED." 1
>
>
> The loop-15.c problem is probably just a missed optimization
> elsewhere that can be fixed.  The problem is that a loop-end
> value used to be computed as "(n - 1) * n + n" which got
> simplified via fold_plusminus_mult_expr to "n * n".  When
> computing in unsigned, however, the expression becomes something
> along the lines of
>
>  "[...] * (unsigned) n + (unsigned) n"
>
> and the top-level of fold_binary_loc removes the *outermost* NOP_EXPRs
> resulting in
>
>  "[...] * (unsigned) n + n"
>
> which fold_plusminus_mult_expr no longer recognizes as something
> it can handle (since "(unsigned) n" is not operand_equal_p to "n").
>
> I think this can be fixed by having fold_plusminus_mult_expr call
> STRIP_NOPS on sub-operands, as is already done elsewhere in fold_binary_loc.
>
> This basically fixes the test case (due to some remaining casts, the
> scan-tree-dump patterns still don't match as-is, but the expected code
> is again generated).
>
>
> The no-scevccp-noreassoc-outer-4.c problem is more difficult, and would
> seem to point to a fundamental problem with performing the computation
> in unsigned mode.  In this case, the end value of an inner loop forms
> part of a scalar evolution of the outer loop.  When computing the end
> value in unsigned type, that scalar evolution is no longer detected.
> In part, this is because the scalar evolution machinery might need to
> be improved in handling casts.  In particular, in some places it only
> does STRIP_USELESS_TYPE_CONVERSION; changing those to STRIP_NOPS makes
> it detect the evolution again.  But I'm not fully convinced this is
> a safe change ...   In any case, this still doesn't make the outer
> loop vectorizable, since it is no longer provably finite.  Without
> the patch, this could be proven *because* the computation of the
> inner loop's end value used signed arithmetic which cannot overflow.
> By performing the computation in unsigned, this information is in
> fact lost.
>
>
> This would seem to indicate that unconditionally using unsigned
> arithmetic even if not strictly necessary might not always be
> the best solution either.  I've gone back and looked that at the
> original problem that
>
>  (start + 1) + (int)((unsigned int) ~start + (unsigned int) end)
>
> is not simplified by fold-const.
>
> Interestingly enough, it *is* valid to simplify this expression
> to just plain "end", even with signed arithmetic, since the
> transformation does not introduce any new potential overflows.
>
> This is actually recognized in fold_binary_loc, but only one special
> case.  See the code around the following comment:
>                  /* The only case we can still associate with two variables
>                     is if they are the same, modulo negation.  */
>
> Unfortunately, this handles only A and -A; it doesn't recognize that
> A+1 is in fact the negation of ~A ...
>
> There is also code in tree-ssa-forwprop.c:associate_plusminus that
> handles quite a number of special cases where re-association *is*
> allowed even for signed arithmetic:
>
>        (A +- B) - A       ->  +- B
>        (A +- B) -+ B      ->  A
>        (CST +- A) +- CST  ->  CST +- A
>        (A + CST) +- CST   ->  A + CST
>        ~A + A             ->  -1
>        ~A + 1             ->  -A
>        A - (A +- B)       ->  -+ B
>        A +- (B +- A)      ->  +- B
>        CST +- (CST +- A)  ->  CST +- A
>        CST +- (A +- CST)  ->  CST +- A
>        A + ~A             ->  -1
>
> This handles some cases involving ~, but still not quite the 

Re: [ping] Vectorizer patches for 4.8

2012-03-12 Thread Richard Guenther
On Thu, Mar 8, 2012 at 3:56 PM, Ulrich Weigand  wrote:
> Hello,
>
> Ira Rosen posted a couple of vectorizer patches intended for 4.8:
>
>   http://gcc.gnu.org/ml/gcc-patches/2012-02/msg00191.html
>   http://gcc.gnu.org/ml/gcc-patches/2012-02/msg00223.html
>
> As she is no longer able to contribute to GCC, she has asked
> me to help push these upstream now that 4.8 is in stage 1.
>
> We've been carrying those patches for a while in our Linaro GCC
> builds for ARM, and they're showing significant improvements in
> certain embedded test cases.
>
> I've now retested both patches on i386-linux with no regressions;
> the PowerPC team has helped with retesting on powerpc64-linux
> with no regressions, and there are (as expected) no significant
> changes in PowerPC benchmark results either.
>
> OK to commit the two patches to mainline?

Ok.

Who will be able to help with problems with those patches?

Thanks,
Richard.

> Bye,
> Ulrich
>
> --
>  Dr. Ulrich Weigand
>  GNU Toolchain for Linux on System z and Cell BE
>  ulrich.weig...@de.ibm.com
>


Re: [PATCH] Don't insert white space in 'orig_option_with_args_text' for OPT_l

2012-03-12 Thread Ludovic Courtès
Hi,

Thanks for the review.

"Joseph S. Myers"  skribis:

> On Fri, 9 Mar 2012, Ludovic Courtès wrote:
>
>>  * gcc/opts-common.c (generate_option): Don't insert white space in
>>  `canonical_option' when OPT_INDEX is OPT_l.
>
> No, opts-common.c should not have special cases for individual options 
> like that.  The canonical form has the separate arguments.

Indeed, and the comment in opts.h makes it clear, though I think I was
confused by the phrase “original text of option”.

> gcc.c has a special case for how it passes this option to
> subprocesses; if you have problems with some output from gfortran
> involving -l options, you should change the gfortran driver as needed
> so it outputs -l options in a different way.

The patch below solves the problem in a gfortran-specific way.  WDYT?

Thanks,
Ludo’.

2012-03-09  Ludovic Courtès  

* gcc/fortran/gfotranspec.c (lang_specific_driver): When
VERBOSE, make sure `-l' options are printed with no intertwined
white spaces.

diff --git a/gcc/fortran/gfortranspec.c b/gcc/fortran/gfortranspec.c
index 2240bfb..55e5e42 100644
--- a/gcc/fortran/gfortranspec.c
+++ b/gcc/fortran/gfortranspec.c
@@ -461,8 +461,15 @@ For more information about these matters, see the file named COPYING\n\n"));
 {
   fprintf (stderr, _("Driving:"));
   for (i = 0; i < g77_newargc; i++)
+	{
+	  if (g77_new_decoded_options[i].opt_index == OPT_l)
+	/* Make sure no white space is inserted after `-l'.  */
+	fprintf (stderr, " -l%s",
+		 g77_new_decoded_options[i].canonical_option[1]);
+	  else
 	fprintf (stderr, " %s",
 		 g77_new_decoded_options[i].orig_option_with_args_text);
+	}
   fprintf (stderr, "\n");
 }


Re: [PATCH] Further VRP improvements

2012-03-12 Thread Richard Guenther
On Thu, 8 Mar 2012, Jakub Jelinek wrote:

> Hi!
> 
> This patch adds ASSERT_EXPRs for
> if ((int) var cmp CST)
> (for cmp >, >=, <, <=).  As the testcase shows, various different tests
> are folded into that form.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

Ok.

Thanks,
Richard.

> 2012-03-08  Jakub Jelinek  
> 
>   PR tree-optimization/51721
>   * tree-vrp.c (register_edge_assert_for_2): Add asserts for unsvar
>   if (int) unsvar cmp CST.
> 
>   * gcc.dg/tree-ssa/vrp64.c: New test.
> 
> --- gcc/tree-vrp.c.jj 2012-03-06 17:02:12.0 +0100
> +++ gcc/tree-vrp.c2012-03-08 11:41:17.749509390 +0100
> @@ -4462,8 +4462,6 @@ register_edge_assert_for_2 (tree name, e
>   }
>  }
>  
> -  /* Similarly add asserts for NAME == CST and NAME being defined as
> - NAME = NAME2 >> CST2.  */
>if (TREE_CODE_CLASS (comp_code) == tcc_comparison
>&& TREE_CODE (val) == INTEGER_CST)
>  {
> @@ -4472,7 +4470,61 @@ register_edge_assert_for_2 (tree name, e
>tree val2 = NULL_TREE;
>unsigned HOST_WIDE_INT mask[2] = { 0, 0 };
>  
> -  /* Extract CST2 from the right shift.  */
> +  /* Add asserts for NAME cmp CST and NAME being defined
> +  as NAME = (int) NAME2.  */
> +  if (!TYPE_UNSIGNED (TREE_TYPE (val))
> +   && (comp_code == LE_EXPR || comp_code == LT_EXPR
> +   || comp_code == GT_EXPR || comp_code == GE_EXPR)
> +   && gimple_assign_cast_p (def_stmt))
> + {
> +   name2 = gimple_assign_rhs1 (def_stmt);
> +   if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt))
> +   && INTEGRAL_TYPE_P (TREE_TYPE (name2))
> +   && TYPE_UNSIGNED (TREE_TYPE (name2))
> +   && (TYPE_PRECISION (TREE_TYPE (val))
> +   == TYPE_PRECISION (TREE_TYPE (name2)))
> +   && (comp_code == LE_EXPR || comp_code == GT_EXPR
> +   || !tree_int_cst_equal (val,
> +   TYPE_MIN_VALUE (TREE_TYPE (val
> +   && live_on_edge (e, name2)
> +   && !has_single_use (name2))
> + {
> +   tree tmp, cst;
> +   enum tree_code new_comp_code = comp_code;
> +
> +   cst = fold_convert (TREE_TYPE (name2),
> +   TYPE_MIN_VALUE (TREE_TYPE (val)));
> +   /* Build an expression for the range test.  */
> +   tmp = build2 (PLUS_EXPR, TREE_TYPE (name2), name2, cst);
> +   cst = fold_build2 (PLUS_EXPR, TREE_TYPE (name2), cst,
> +  fold_convert (TREE_TYPE (name2), val));
> +   if (comp_code == LT_EXPR || comp_code == GE_EXPR)
> + {
> +   new_comp_code = comp_code == LT_EXPR ? LE_EXPR : GT_EXPR;
> +   cst = fold_build2 (MINUS_EXPR, TREE_TYPE (name2), cst,
> +  build_int_cst (TREE_TYPE (name2), 1));
> + }
> +
> +   if (dump_file)
> + {
> +   fprintf (dump_file, "Adding assert for ");
> +   print_generic_expr (dump_file, name2, 0);
> +   fprintf (dump_file, " from ");
> +   print_generic_expr (dump_file, tmp, 0);
> +   fprintf (dump_file, "\n");
> + }
> +
> +   register_new_assert_for (name2, tmp, new_comp_code, cst, NULL,
> +e, bsi);
> +
> +   retval = true;
> + }
> + }
> +
> +  /* Add asserts for NAME cmp CST and NAME being defined as
> +  NAME = NAME2 >> CST2.
> +
> +  Extract CST2 from the right shift.  */
>if (is_gimple_assign (def_stmt)
> && gimple_assign_rhs_code (def_stmt) == RSHIFT_EXPR)
>   {
> @@ -4500,7 +4552,6 @@ register_edge_assert_for_2 (tree name, e
> val2 = fold_binary (LSHIFT_EXPR, TREE_TYPE (val), val, cst2);
>   }
>   }
> -
>if (val2 != NULL_TREE
> && TREE_CODE (val2) == INTEGER_CST
> && simple_cst_equal (fold_build2 (RSHIFT_EXPR,
> --- gcc/testsuite/gcc.dg/tree-ssa/vrp64.c.jj  2012-03-08 12:58:05.773797384 
> +0100
> +++ gcc/testsuite/gcc.dg/tree-ssa/vrp64.c 2012-03-08 12:57:26.0 
> +0100
> @@ -0,0 +1,152 @@
> +/* PR tree-optimization/51721 */
> +/* { dg-do link } */
> +/* { dg-options "-O2" } */
> +
> +extern void link_error (void);
> +
> +#define BITSM1 (sizeof (int) * __CHAR_BIT__ - 1)
> +
> +void
> +f1 (unsigned int s)
> +{
> +  if (s >> BITSM1 != 0)
> +{
> +  if (s == 0 || s == 5 || s == __INT_MAX__)
> + link_error ();
> +}
> +  else
> +{
> +  if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U)
> + link_error ();
> +}
> +}
> +
> +void
> +f2 (int s)
> +{
> +  if (s >> BITSM1 == 0)
> +{
> +  if (s == -1 || s == -5 || s == -__INT_MAX__ - 1)
> + link_error ();
> +}
> +  else
> +{
> +  if (s == 0 || s == 5 || s == __INT_MAX__)
> + link_error ();
> +}
> +}
> +
> +void
> +f3 (unsigned int s)
> +{
> +  if ((s & (1U 

Re: Support for Runtime CPU type detection via builtins (issue5754058)

2012-03-12 Thread Richard Guenther
On Thu, Mar 8, 2012 at 9:35 PM, Xinliang David Li  wrote:
> On Wed, Mar 7, 2012 at 5:51 AM, Richard Guenther
>  wrote:
>> On Wed, Mar 7, 2012 at 1:49 AM, Sriraman Tallam  wrote:
>>> Patch for CPU detection at run-time.
>>> ===
>>>
>>> Patch for CPU detection at run-time, to be used in dispatching of
>>> multi-versioned functions.   Please see this discussion:
>>> http://gcc.gnu.org/ml/gcc-patches/2011-08/msg01355.html
>>> when this patch for reviewed the last time.
>>>
>>> For more detailed description:
>>> http://gcc.gnu.org/ml/gcc/2012-03/msg00074.html
>>>
>>> One of the main concerns was about making CPU detection initialization a
>>> constructor. The main point raised was about constructor ordering. I have
>>> added a priority value to the CPU detection constructor to make it very high
>>> priority so that it is guaranteed to fire before every constructor without
>>> an explicitly marked priority value of 101.  However, IFUNC initializers
>>> will still fire before this constructor, so the cpu initialization routine
>>> has to be explicitly called in such initializers for which I have added a
>>> builtin: __builtin_cpu_init ().
>>>
>>> This patch adds the following new builtins:
>>>
>>> * __builtin_cpu_init
>>> * __builtin_cpu_supports_cmov
>>> * __builtin_cpu_supports_mmx
>>> * __builtin_cpu_supports_popcount
>>> * __builtin_cpu_supports_sse
>>> * __builtin_cpu_supports_sse2
>>> * __builtin_cpu_supports_sse3
>>> * __builtin_cpu_supports_ssse3
>>> * __builtin_cpu_supports_sse4_1
>>> * __builtin_cpu_supports_sse4_2
>>> * __builtin_cpu_is_amd
>>> * __builtin_cpu_is_intel_atom
>>> * __builtin_cpu_is_intel_core2
>>> * __builtin_cpu_is_intel
>>> * __builtin_cpu_is_intel_corei7
>>> * __builtin_cpu_is_intel_corei7_nehalem
>>> * __builtin_cpu_is_intel_corei7_westmere
>>> * __builtin_cpu_is_intel_corei7_sandybridge
>>> * __builtin_cpu_is_amdfam10
>>> * __builtin_cpu_is_amdfam10_barcelona
>>> * __builtin_cpu_is_amdfam10_shanghai
>>> * __builtin_cpu_is_amdfam10_istanbul
>>> * __builtin_cpu_is_amdfam15_bdver1
>>> * __builtin_cpu_is_amdfam15_bdver2
>>
>> I think the non-feature detection functions are not necessary at all.
>
> They are useful if compiler needs to do auto versioning based on cpu model.
>
>> Builtin functions are not exactly cheap, nor is the scheme you invent
>> backward/forward compatible.  Instead, why not add a single builtin
>> function, __builtin_cpu_supports(const char *), and decode from
>> a comma-separated list of features?  Unknown features are simply
>> "not present".  So I can write code with only a single configure check,
>
> This is a good idea.
>
> __builtin_is_cpu (const char* );
> __builtin_cpu_supports (char char*);

That looks good to me.

Richard.

> thanks,
>
> David
>
>
>> for __builtin_cpu_supports, and cater for future features or older compilers.
>>
>> And of course that builtin would be even cross-platform.
>>
>> Implementation-wise I'll leave this to x86 maintainers to comment on.
>>
>> Richard.
>>
>>>
>>>        * config/i386/i386.c (build_struct_with_one_bit_fields): New 
>>> function.
>>>        (make_var_decl): New function.
>>>        (get_field_from_struct): New function.
>>>        (fold_builtin_target): New function.
>>>        (ix86_fold_builtin): New function.
>>>        (ix86_expand_builtin): Expand new builtins by folding them.
>>>        (make_platform_builtin): New functions.
>>>        (ix86_init_platform_type_builtins): Make the new builtins.
>>>        (ix86_init_builtins): Make new builtins to detect CPU type.
>>>        (TARGET_FOLD_BUILTIN): New macro.
>>>        (IX86_BUILTIN_CPU_SUPPORTS_CMOV): New enum value.
>>>        (IX86_BUILTIN_CPU_SUPPORTS_MMX): New enum value.
>>>        (IX86_BUILTIN_CPU_SUPPORTS_POPCOUNT): New enum value.
>>>        (IX86_BUILTIN_CPU_SUPPORTS_SSE): New enum value.
>>>        (IX86_BUILTIN_CPU_SUPPORTS_SSE2): New enum value.
>>>        (IX86_BUILTIN_CPU_SUPPORTS_SSE3): New enum value.
>>>        (IX86_BUILTIN_CPU_SUPPORTS_SSSE3): New enum value.
>>>        (IX86_BUILTIN_CPU_SUPPORTS_SSE4_1): New enum value.
>>>        (IX86_BUILTIN_CPU_SUPPORTS_SSE4_2): New enum value.
>>>        (IX86_BUILTIN_CPU_INIT): New enum value.
>>>        (IX86_BUILTIN_CPU_IS_AMD): New enum value.
>>>        (IX86_BUILTIN_CPU_IS_INTEL): New enum value.
>>>        (IX86_BUILTIN_CPU_IS_INTEL_ATOM): New enum value.
>>>        (IX86_BUILTIN_CPU_IS_INTEL_CORE2): New enum value.
>>>        (IX86_BUILTIN_CPU_IS_INTEL_COREI7_NEHALEM): New enum value.
>>>        (IX86_BUILTIN_CPU_IS_INTEL_COREI7_WESTMERE): New enum value.
>>>        (IX86_BUILTIN_CPU_IS_INTEL_COREI7_SANDYBRIDGE): New enum value.
>>>        (IX86_BUILTIN_CPU_IS_AMDFAM10_BARCELONA): New enum value.
>>>        (IX86_BUILTIN_CPU_IS_AMDFAM10_SHANGHAI): New enum value.
>>>        (IX86_BUILTIN_CPU_IS_AMDFAM10_ISTANBUL): New enum value.
>>>        (IX86_BUILTIN_CPU_IS_AMDFAM15H_BDVER1): New enum value.
>>>        (IX86_BUILTIN_CPU_IS_AMDFAM15H_BDVER2): New enum value

Re: [PATCH] Further VRP improvements (take 2)

2012-03-12 Thread Richard Guenther
On Fri, 9 Mar 2012, Jakub Jelinek wrote:

> On Thu, Mar 08, 2012 at 04:54:31PM +0100, Jakub Jelinek wrote:
> > This patch adds ASSERT_EXPRs for
> > if ((int) var cmp CST)
> > (for cmp >, >=, <, <=).  As the testcase shows, various different tests
> > are folded into that form.
> > 
> > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 
> This patch no longer applies after the PR tree-optimization/52533 fix,
> so here is an updated patch that does apply and contains a tiny cleanup too:

Ok.

Thanks,
Richard.

> 2012-03-09  Jakub Jelinek  
> 
>   PR tree-optimization/51721
>   * tree-vrp.c (register_edge_assert_for_2): Add asserts for unsvar
>   if (int) unsvar cmp CST.
> 
>   * gcc.dg/tree-ssa/vrp64.c: New test.
> 
> --- gcc/tree-vrp.c.jj 2012-03-09 12:30:19.348501480 +0100
> +++ gcc/tree-vrp.c2012-03-09 12:53:41.844227149 +0100
> @@ -4462,8 +4462,6 @@ register_edge_assert_for_2 (tree name, e
>   }
>  }
>  
> -  /* Similarly add asserts for NAME == CST and NAME being defined as
> - NAME = NAME2 >> CST2.  */
>if (TREE_CODE_CLASS (comp_code) == tcc_comparison
>&& TREE_CODE (val) == INTEGER_CST)
>  {
> @@ -4473,7 +4471,60 @@ register_edge_assert_for_2 (tree name, e
>double_int mask = double_int_zero;
>unsigned int prec = TYPE_PRECISION (TREE_TYPE (val));
>  
> -  /* Extract CST2 from the right shift.  */
> +  /* Add asserts for NAME cmp CST and NAME being defined
> +  as NAME = (int) NAME2.  */
> +  if (!TYPE_UNSIGNED (TREE_TYPE (val))
> +   && (comp_code == LE_EXPR || comp_code == LT_EXPR
> +   || comp_code == GT_EXPR || comp_code == GE_EXPR)
> +   && gimple_assign_cast_p (def_stmt))
> + {
> +   name2 = gimple_assign_rhs1 (def_stmt);
> +   if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def_stmt))
> +   && INTEGRAL_TYPE_P (TREE_TYPE (name2))
> +   && TYPE_UNSIGNED (TREE_TYPE (name2))
> +   && prec == TYPE_PRECISION (TREE_TYPE (name2))
> +   && (comp_code == LE_EXPR || comp_code == GT_EXPR
> +   || !tree_int_cst_equal (val,
> +   TYPE_MIN_VALUE (TREE_TYPE (val
> +   && live_on_edge (e, name2)
> +   && !has_single_use (name2))
> + {
> +   tree tmp, cst;
> +   enum tree_code new_comp_code = comp_code;
> +
> +   cst = fold_convert (TREE_TYPE (name2),
> +   TYPE_MIN_VALUE (TREE_TYPE (val)));
> +   /* Build an expression for the range test.  */
> +   tmp = build2 (PLUS_EXPR, TREE_TYPE (name2), name2, cst);
> +   cst = fold_build2 (PLUS_EXPR, TREE_TYPE (name2), cst,
> +  fold_convert (TREE_TYPE (name2), val));
> +   if (comp_code == LT_EXPR || comp_code == GE_EXPR)
> + {
> +   new_comp_code = comp_code == LT_EXPR ? LE_EXPR : GT_EXPR;
> +   cst = fold_build2 (MINUS_EXPR, TREE_TYPE (name2), cst,
> +  build_int_cst (TREE_TYPE (name2), 1));
> + }
> +
> +   if (dump_file)
> + {
> +   fprintf (dump_file, "Adding assert for ");
> +   print_generic_expr (dump_file, name2, 0);
> +   fprintf (dump_file, " from ");
> +   print_generic_expr (dump_file, tmp, 0);
> +   fprintf (dump_file, "\n");
> + }
> +
> +   register_new_assert_for (name2, tmp, new_comp_code, cst, NULL,
> +e, bsi);
> +
> +   retval = true;
> + }
> + }
> +
> +  /* Add asserts for NAME cmp CST and NAME being defined as
> +  NAME = NAME2 >> CST2.
> +
> +  Extract CST2 from the right shift.  */
>if (is_gimple_assign (def_stmt)
> && gimple_assign_rhs_code (def_stmt) == RSHIFT_EXPR)
>   {
> @@ -4491,7 +4542,6 @@ register_edge_assert_for_2 (tree name, e
> val2 = fold_binary (LSHIFT_EXPR, TREE_TYPE (val), val, cst2);
>   }
>   }
> -
>if (val2 != NULL_TREE
> && TREE_CODE (val2) == INTEGER_CST
> && simple_cst_equal (fold_build2 (RSHIFT_EXPR,
> --- gcc/testsuite/gcc.dg/tree-ssa/vrp64.c.jj  2012-03-09 12:45:23.287171268 
> +0100
> +++ gcc/testsuite/gcc.dg/tree-ssa/vrp64.c 2012-03-09 12:45:23.287171268 
> +0100
> @@ -0,0 +1,152 @@
> +/* PR tree-optimization/51721 */
> +/* { dg-do link } */
> +/* { dg-options "-O2" } */
> +
> +extern void link_error (void);
> +
> +#define BITSM1 (sizeof (int) * __CHAR_BIT__ - 1)
> +
> +void
> +f1 (unsigned int s)
> +{
> +  if (s >> BITSM1 != 0)
> +{
> +  if (s == 0 || s == 5 || s == __INT_MAX__)
> + link_error ();
> +}
> +  else
> +{
> +  if (s == 1U + __INT_MAX__ || s == 6U + __INT_MAX__ || s == -1U)
> + link_error ();
> +}
> +}
> +
> +void
> +f2 (int s)
> +{
> +  if (s >> BITSM1 == 0)
> +{
> +  if (s == -1 || s == -5 || s == -__INT_MAX__ - 1)

Re: [PATCH] Make powerpc honor PROCESSOR_DEFAULT{,64} in tm*.h files

2012-03-12 Thread Richard Guenther
On Fri, Mar 9, 2012 at 5:57 PM, Michael Meissner
 wrote:
> On Fri, Mar 09, 2012 at 11:04:17AM -0500, David Edelsohn wrote:
>> Let's try this on trunk and hopefully it can be included in the
>> release candidate.
>
> Committed, subversion id 185146.

Ok for the branch.

Thanks,
Richard.

> --
> Michael Meissner, IBM
> 5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA
> meiss...@linux.vnet.ibm.com     fax +1 (978) 399-6899
>


[PATCH] : Fix negative value in TEST_BIT from mem_overlaps_already_clobbered_arg_p()

2012-03-12 Thread mickael guene

Hi all,

 After applying patch from 
http://gcc.gnu.org/ml/gcc-patches/2012-02/msg00228.html we can
have a negative value in call to TEST_BIT() macro in 
mem_overlaps_already_clobbered_arg_p() function
for stored_args_map bitmap table.
 This can lead to reject a valid tail call optimization.

 This patch will ensure that i+k is positive before calling TEST_BIT() macro.

2012-03-12  Mickael Guene  

* calls.c (mem_overlaps_already_clobbered_arg_p): Don't call TEST_BIT 
for
negative value.

Regards

Mickael
--- a/gcc/calls.c	2012-03-12 10:44:27.0 +0100
+++ b/gcc/calls.c	2012-03-12 10:46:16.0 +0100
@@ -1822,7 +1822,8 @@
   unsigned HOST_WIDE_INT k;
 
   for (k = 0; k < size; k++)
-	if (i + k < stored_args_map->n_bits
+	if (i + k >= 0
+	&& i + k < stored_args_map->n_bits
 	&& TEST_BIT (stored_args_map, i + k))
 	  return true;
 }


[VMS/committed]: Add -mpointer-size switch

2012-03-12 Thread Tristan Gingold
Hi,

Now that '#pragma pointer_size' is supported by GCC for VMS, we can add the 
'-mpointer-size' switch (modeled on /POINTER_SIZE=xx DEC-C qualifier) to set 
the default pointer size.  This also makes alpha64-dec-*vms* target obsolete 
(but still supported by alpha*-dec-*vms*).
The patch has many chunks to adjust ™ declarations.  Documentation will follow.

Tested by build gcc, committed on trunk.

Tristan.

2012-03-12  Tristan Gingold  

   * config/vms/vms.opt: Add vms-opts.h header.
   (mmalloc64): Use flag_vms_malloc64 flag instead of MALLOC64
   target mask.
   (-mvms-return-codes): Document.
   (-mpointer-size): New option.
   (vms_pointer_size): Add enumeration.
   * config/vms/vms-opts.h: New file.
   * config/vms/vms.h (TARGET_OS_CPP_BUILTINS): Define
   __INITIAL_POINTER_SIZE.
   (POINTER_SIZE, SIZE_TYPE, PTRDIFF_TYPE): Adjust definition.
   (C_COMMON_OVERRIDE_OPTIONS): Define.
   (DWARF2_ADDR_SIZE): Define.
   * config/vms/vms.c (vms_patch_builtins): Adjust condition.
   * config/vms/vms-protos.h (vms_c_common_override_options):
   New prototype.
   * config/vms/vms-c.c (vms_pragma_pointer_size): Ignore pragma
   if -mno-pointer-size.
   (vms_c_common_override_options): New function.
   * config/ia64/vms.h (TARGET_DEFAULT): Remove MASK_MALLOC64.
   * config/alpha/vms.h (TARGET_DEFAULT): Remove MASK_MALLOC64.
   (MALLOC_ABI_ALIGNMENT): Use flag_vms_malloc64
   and flag_vms_pointer_size.
   (MASK_RETURN_ADDR): Set according to flag_vms_pointer_size.
   * config.gcc (*-*-*vms*): Define xm_file.
   (alpha*-dec-*vms*): Do not define xm_file.
   (alpha64-dec-*vms*): Remove.
   (ia64-hp-*vms*): Do not define xm_file.  Simplify tm_file
   and tmake_file.

ada/
2012-03-12  Tristan Gingold  

   * gcc-interface/decl.c (gnat_to_gnu_param): Use flag_vms_malloc64
   instead of TARGET_MALLOC64.
   * gcc-interface/gigi.h (flag_vms_malloc64): Define instead
   of TARGET_MALLOC64.

libgcc/
2012-03-12  Tristan Gingold  

   * config/alpha/t-vms: Define HOST_LIBGCC2_CFLAGS.
   * config/ia64/t-vms: Likewise.

diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 34183ba..120628e 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -5488,7 +5488,7 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type 
mech,
 
   /* VMS descriptors are themselves passed by reference.  */
   if (mech == By_Short_Descriptor ||
-  (mech == By_Descriptor && TARGET_ABI_OPEN_VMS && !TARGET_MALLOC64))
+  (mech == By_Descriptor && TARGET_ABI_OPEN_VMS && !flag_vms_malloc64))
 gnu_param_type
   = build_pointer_type (build_vms_descriptor32 (gnu_param_type,
Mechanism (gnat_param),
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index 5e6495a..f7d787b 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -999,13 +999,11 @@ extern void enumerate_modes (void (*f) (const char *, 
int, int, int, int, int,
intrusive preprocessor directives.  */
 #ifndef TARGET_ABI_OPEN_VMS
 #define TARGET_ABI_OPEN_VMS 0
-#endif
 
-/* VMS macro set by default, when clear forces 32bit mallocs and 32bit
+/* VMS option set by default, when clear forces 32bit mallocs and 32bit
Descriptors. Always used in combination with TARGET_ABI_OPEN_VMS
so no effect on non-VMS systems.  */
-#ifndef TARGET_MALLOC64
-#define TARGET_MALLOC64 0
+#define flag_vms_malloc64 0
 #endif
 
 /* Convenient shortcuts.  */
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 99f0b47..053f6ec 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -735,6 +735,7 @@ case ${target} in
   extra_objs="vms.o"
   target_gtfiles="$target_gtfiles \$(srcdir)/config/vms/vms.c"
   tm_p_file="${tm_p_file} vms/vms-protos.h"
+  xm_file="vms/xm-vms.h"
   c_target_objs="vms-c.o"
   cxx_target_objs="vms-c.o"
   if test x$gnu_ld != xyes; then
@@ -809,14 +810,8 @@ alpha*-dec-osf5.1*)
;;
esac
;;
-alpha64-dec-*vms*)
-   tm_file="${tm_file} vms/vms.h vms/vms64.h alpha/vms.h"
-   xm_file="alpha/xm-vms.h vms/xm-vms64.h"
-   tmake_file="${tmake_file} vms/t-vms64 alpha/t-vms"
-   ;;
 alpha*-dec-*vms*)
tm_file="${tm_file} vms/vms.h alpha/vms.h"
-   xm_file="alpha/xm-vms.h"
tmake_file="${tmake_file} alpha/t-vms"
;;
 arm-wrs-vxworks)
@@ -1554,9 +1549,8 @@ ia64*-*-hpux*)
esac
;;
 ia64-hp-*vms*)
-   tm_file="${tm_file} elfos.h ia64/sysv4.h ia64/elf.h vms/vms.h 
vms/vms64.h ia64/vms.h"
-   xm_file="vms/xm-vms.h vms/xm-vms64.h"
-   tmake_file="${tmake_file} vms/t-vms64 ia64/t-ia64"
+   tm_file="${tm_file} elfos.h ia64/sysv4.h vms/vms.h ia64/vms.h"
+   tmake_file="${tmake_file} ia64/t-ia64"
target_cpu_default="0"
if test x$gas = xyes
then
diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha

Re: [patch, RFA] delete obsolete -madjust-unroll option for SH

2012-03-12 Thread Richard Guenther
On Sat, Mar 10, 2012 at 5:25 AM, Sandra Loosemore
 wrote:
> When I was working on cleanups to invoke.texi I noticed this bit in the
> SH Options section:
>
> @item -madjust-unroll
> @opindex madjust-unroll
> Throttle unrolling to avoid thrashing target registers.
> This option only has an effect if the GCC code base supports the
> TARGET_ADJUST_UNROLL_MAX target hook.
>
> Well, the current manual is supposed to document what the current GCC
> code base does, so I looked up this target hook and found it was deleted
> in 2007 with a ChangeLog note that it has been dead since gcc 4.0.0.
> However the command-line option is still present.  :-S
>
> Any reason why we should not delete this entirely, per the attached patch?
> I haven't built/tested this (except for the manual) but can do that if the
> patch isn't sufficiently obvious.

Command-line options have to be preserved for backward-compatibility
so old makefiles do not fail.  Though the entry in the .opt file should match

madjust-unroll
Target Ignore
Does nothing. Preserved for backward compatibility.

The documentation can be removed, of course.

Richard.

> -Sandra
>
>
> 2012-03-09  Sandra Loosemore  
>
>        gcc/
>        * config/sh/sh.opt (madjust-unroll): Delete.
>        * config/sh/sh.h (TARGET_OPT_DEFAULT): Don't use MASK_ADJUST_UNROLL.
>        * doc/invoke.texi (Option Summary): Remove -madjust-unroll.
>        (SH Options): Likewise.


Re: [PATCH] Improve PHI-OPT when there are multiple phis

2012-03-12 Thread Richard Guenther
On Sat, Mar 10, 2012 at 8:55 AM, Andrew Pinski
 wrote:
> Woops I forgot the patch.

Ok.

Thanks,
Richard.

> Thanks,
> Andrew Pinski
>
> On Fri, Mar 9, 2012 at 11:45 AM, Andrew Pinski
>  wrote:
>> On Tue, Jan 24, 2012 at 2:50 AM, Richard Guenther
>>  wrote:
>>> On Tue, Jan 24, 2012 at 7:34 AM, Andrew Pinski
>>>  wrote:
 Hi,
  Right now PHI-OPT does try to handle the case where we have multiple
 PHIs but the other PHIs have the same value for the edges we care
 about.
 This fixes the issue and allows PHI-OPT to handle a few more cases and
 it removes the TODO in the comments.

 OK For 4.8? Bootstrapped and tested on x86_64-linux-gnu with no 
 regressions.

 Thanks,
 Andrew Pinski

 ChangeLog:
 * tree-ssa-phiopt.c (gimple_phi_singleton_for_edges): New function.
>>>
>>> The name is confusing I think, because it returns the single non-singleton
>>> PHI for the edge pair ... you can avoid choosing a better name by
>>> inlining it to its single call site.  I'd maybe name it
>>> single_non_singleton_phi_for_edges.
>>>
>>> Otherwise ok.
>>
>> Here is the updated patch with one small change, value_replacement
>> uses single_non_singleton_phi_for_edges now too.
>>
>> OK still?  Bootstrapped and tested on x86_64-linux-gnu with no regressions.
>>
>>
>> Thanks,
>> Andrew Pinski
>>
>>
>> ChangeLog:
>> * tree-ssa-phiopt.c (single_non_singleton_phi_for_edges): New function.
>> (tree_ssa_phiopt_worker): Use single_non_singleton_phi_for_edges.
>> (value_replacement): Likewise.
>> (empty_block_p): Check also if the PHIs for the block are empty.
>>
>> testsuite/ChangeLog:
>> * gcc.dg/tree-ssa/phi-opt-7.c: New testcase.
>>
>>
>>>
>>> Thanks,
>>> Richard.
>>>
 (tree_ssa_phiopt_worker): Use gimple_phi_singleton_for_edges.
 (empty_block_p): Check also if the PHIs for the block are empty.

 testsuite/ChangeLog:
 * gcc.dg/tree-ssa/phi-opt-7.c: New testcase.


Re: [PR51752] publication safety violations in loop invariant motion pass

2012-03-12 Thread Richard Guenther
On Fri, Mar 9, 2012 at 10:48 PM, Aldy Hernandez  wrote:
>
>> Note that partial PRE (enabled at -O3) can insert expressions into paths
>> that did _not_ execute the expression.  For regular PRE you are right.
>>
>> Richard.
>
>
> I've thought about this some more, and Torvald's comment makes a lot of
> sense.  PRE can make things completely redundant, and a later pass may move
> things before its publication.  I believe it's wise to disable PRE inside
> transactions as originally discussed.  The attached patch does so.
>
> Below is an example (from my patch) with an explanation of what may go
> wrong.
>
> Torvald is this what you were thinking of?
>
> Richards, is this OK for the 4.7 branch and trunk (pending tests)?

+ if (flag_tm
+ && gimple_in_transaction (stmt)
+ && gimple_assign_single_p (stmt))
+   {
+ tree rhs = gimple_assign_rhs1 (stmt);
+ if (DECL_P (rhs) && is_global_var (rhs))
+   continue;

this does not cover a read like 'a.b', nor a '*p' read.  I think in some other
thread I sketched some ref_may_refer_to_global function, maybe you
remember.

Richard.

> Thanks.
> Aldy
>
> +         /* Non local loads in a transaction cannot be hoisted out,
> +            because they may make partially redundant expressions
> +            totally redundant, which a later pass may move before its
> +            publication by another thread.
> +
> +            For example:
> +
> +              __transaction_atomic {
> +                if (flag)
> +                  y = x + 4;
> +                else
> +                  // stuff
> +                z = x + 4;
> +              }
> +
> +            PRE can rewrite this into:
> +
> +              __transaction_atomic {
> +                if (flag) {
> +                  tmp = x + 4;
> +                  y = tmp;
> +                } else {
> +                  // stuff
> +                  tmp = x + 4;
> +                }
> +                z = tmp;
> +              }
> +
> +            A later pass can move the now totally redundant [x + 4]
> +            before its publication predicated by "flag":
> +
> +              __transaction_atomic {
> +                tmp = x + 4;
> +                if (flag) {
> +                } else {
> +                  // stuff
> +                }
> +                z = tmp;
> +         */


Re: Many regressions with: [patch] Cleanup fortran/convert.c

2012-03-12 Thread Richard Guenther
On Sat, Mar 10, 2012 at 12:21 PM, Steven Bosscher  wrote:
> On Sat, Mar 10, 2012 at 11:19 AM, Tobias Burnus  wrote:
>> Steven Bosscher wrote:
>>>
>>> This cleans up some remnants of the ancestors of fortran's convert.c,
>>> which was copied from GNAT IIRC. I would bootstrap&test this, but trunk
>>> appears to be broken for x86_64-linux right now (ICE in patch_jump_insn).
>>> But I can post this
>>> for review, at least.
>>> OK for trunk, after bootstrap+test?
>>
>>
>> Your patch seems to have caused many Fortran regressions. At least I see
>> with 185156 only one (known) failure, cf.
>> http://gcc.gnu.org/ml/gcc-testresults/2012-03/msg01069.html
>>
>> While starting with 185160 there are many, many gfortran failures, cf.
>> http://gcc.gnu.org/ml/gcc-testresults/2012-03/msg01073.html
>
> Yes, it seems that different boolean types aren't allowed. I must have
> looked at the wrong test results somehow.
>
> I'm testing this fix:
>
> Index: convert.c
> ===
> --- convert.c   (revision 185160)
> +++ convert.c   (working copy)
> @@ -95,7 +95,8 @@ convert (tree type, tree expr)
>   if (code == VOID_TYPE)
>     return fold_build1_loc (input_location, CONVERT_EXPR, type, e);
>   if (code == BOOLEAN_TYPE)
> -    return truthvalue_conversion (e);
> +    return fold_build1_loc (input_location, NOP_EXPR, type,
> +                           truthvalue_conversion (e));

   return fold_convert_loc (input_location, type, truthvalue_conversion (e));

>   if (code == INTEGER_TYPE)
>     return fold (convert_to_integer (type, e));
>   if (code == POINTER_TYPE || code == REFERENCE_TYPE)


Re: [committed] Skip gcc.dg/torture/pr52402.c execution on 32-bit hppa*-*-hpux*

2012-03-12 Thread Richard Guenther
On Sat, Mar 10, 2012 at 11:53 PM, John David Anglin
 wrote:
> Tested on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11.  Committed to trunk.
>
> Ok for 4.7?

Ok.

Thanks,
Richard.

> Dave
> --
> J. David Anglin                                  dave.ang...@nrc-cnrc.gc.ca
> National Research Council of Canada              (613) 990-0752 (FAX: 
> 952-6602)
>
> 2012-03-10  John David Anglin  
>
>        PR target/52450
>        * gcc.dg/torture/pr52402.c: Skip execution on 32-bit hppa*-*-hpux*.
>
> Index: gcc.dg/torture/pr52402.c
> ===
> --- gcc.dg/torture/pr52402.c    (revision 185121)
> +++ gcc.dg/torture/pr52402.c    (working copy)
> @@ -1,6 +1,7 @@
>  /* { dg-do run } */
>  /* { dg-options "-w -Wno-psabi" } */
>  /* { dg-require-effective-target int32plus } */
> +/* { dg-xfail-run-if "pr52450" { { hppa*-*-hpux* } && { ! lp64 } } } */
>
>  typedef int v4si __attribute__((vector_size(16)));
>  struct T { v4si i[2]; int j; } __attribute__((packed));


Re: [C++ Patch] for c++/52465

2012-03-12 Thread Dodji Seketeli
Hello Fabien,

Fabien Chêne  a écrit:

[...]

> Index: gcc/cp/decl.c
> ===
> --- gcc/cp/decl.c (revision 184891)
> +++ gcc/cp/decl.c (working copy)
> @@ -8686,6 +8686,9 @@ grokdeclarator (const cp_declarator *dec
>type = NULL_TREE;
>type_was_error_mark_node = true;
>  }
> +
> +  type = strip_using_decl (type);
> +

I am a little bit curious as to why this change is necessary.  It seems
to me that the test case of your patch would pass even without this
change, wouldn't it?

Thanks.

-- 
Dodji


Re: [PATCH] Don't insert white space in 'orig_option_with_args_text' for OPT_l

2012-03-12 Thread Joseph S. Myers
On Mon, 12 Mar 2012, Ludovic Court?s wrote:

> The patch below solves the problem in a gfortran-specific way.  WDYT?

I think that's the right approach for this issue.

-- 
Joseph S. Myers
jos...@codesourcery.com

Re: [PATCH] Do not use lang_hooks.types.type_for_size in signed_or_unsigned_type_for

2012-03-12 Thread Richard Guenther
On Wed, 7 Mar 2012, Richard Guenther wrote:

> On Wed, 7 Mar 2012, Michael Matz wrote:
> 
> > Hi,
> > 
> > On Wed, 7 Mar 2012, Richard Guenther wrote:
> > 
> > > FAIL: gcc.dg/tree-ssa/pr31261.c scan-tree-dump-times original "return 
> > > \\(char\\)
> > >  -\\(unsigned char\\) c & 31;" 1
> > > FAIL: gcc.dg/tree-ssa/pr31261.c scan-tree-dump-times original "return 
> > > \\(int\\) 
> > > \\(12 - \\(unsigned int\\) d\\) & 7;" 1
> > > 
> > > because we dump the unsigned type variant differently now.  What do
> > > people think - adjust the testcase?  Adjust how we pretty-print
> > > these non-standard integer types?
> > 
> > Adjusting the pretty printer would be nice anyway.  Those :35 
> > thingies hurt my eyes.  Just printing int17 or uint18 would be perfectly 
> > fine, with special casing of sizes that match the normal C types for 
> > the target in question (so that input 'unsigned char' isn't converted to 
> > 'uint8' on one and 'uint16' on another target).
> 
> Ok, I'll do that (special-casing some precisions via *_TYPE_SIZE).
> I won't touch the  stuff, for now.

Like so.

Richard.

2012-03-12  Richard Guenther  

* tree.c (signed_or_unsigned_type_for): Use
build_nonstandard_integer_type.
(signed_type_for): Adjust documentation.
(unsigned_type_for): Likewise.
* tree-pretty-print.c (dump_generic_node): Use standard names
for non-standard integer types if available.

Index: gcc/tree.c
===
*** gcc/tree.c.orig 2012-03-12 11:11:36.0 +0100
--- gcc/tree.c  2012-03-12 12:25:37.0 +0100
*** widest_int_cst_value (const_tree x)
*** 10197,10228 
return val;
  }
  
! /* If TYPE is an integral type, return an equivalent type which is
! unsigned iff UNSIGNEDP is true.  If TYPE is not an integral type,
! return TYPE itself.  */
  
  tree
  signed_or_unsigned_type_for (int unsignedp, tree type)
  {
!   tree t = type;
!   if (POINTER_TYPE_P (type))
! {
!   /* If the pointer points to the normal address space, use the
!size_type_node.  Otherwise use an appropriate size for the pointer
!based on the named address space it points to.  */
!   if (!TYPE_ADDR_SPACE (TREE_TYPE (t)))
!   t = size_type_node;
!   else
!   return lang_hooks.types.type_for_size (TYPE_PRECISION (t), unsignedp);
! }
  
!   if (!INTEGRAL_TYPE_P (t) || TYPE_UNSIGNED (t) == unsignedp)
! return t;
  
!   return lang_hooks.types.type_for_size (TYPE_PRECISION (t), unsignedp);
  }
  
! /* Returns unsigned variant of TYPE.  */
  
  tree
  unsigned_type_for (tree type)
--- 10197,10222 
return val;
  }
  
! /* If TYPE is an integral or pointer type, return an integer type with
!the same precision which is unsigned iff UNSIGNEDP is true, or itself
!if TYPE is already an integer type of signedness UNSIGNEDP.  */
  
  tree
  signed_or_unsigned_type_for (int unsignedp, tree type)
  {
!   if (TREE_CODE (type) == INTEGER_TYPE && TYPE_UNSIGNED (type) == unsignedp)
! return type;
  
!   if (!INTEGRAL_TYPE_P (type)
!   && !POINTER_TYPE_P (type))
! return NULL_TREE;
  
!   return build_nonstandard_integer_type (TYPE_PRECISION (type), unsignedp);
  }
  
! /* If TYPE is an integral or pointer type, return an integer type with
!the same precision which is unsigned, or itself if TYPE is already an
!unsigned integer type.  */
  
  tree
  unsigned_type_for (tree type)
*** unsigned_type_for (tree type)
*** 10230,10236 
return signed_or_unsigned_type_for (1, type);
  }
  
! /* Returns signed variant of TYPE.  */
  
  tree
  signed_type_for (tree type)
--- 10224,10232 
return signed_or_unsigned_type_for (1, type);
  }
  
! /* If TYPE is an integral or pointer type, return an integer type with
!the same precision which is signed, or itself if TYPE is already a
!signed integer type.  */
  
  tree
  signed_type_for (tree type)
Index: gcc/tree-pretty-print.c
===
*** gcc/tree-pretty-print.c.orig2012-01-30 14:44:40.0 +0100
--- gcc/tree-pretty-print.c 2012-03-12 12:34:01.0 +0100
*** dump_generic_node (pretty_printer *buffe
*** 723,733 
  }
else if (TREE_CODE (node) == INTEGER_TYPE)
  {
!   pp_string (buffer, (TYPE_UNSIGNED (node)
!   ? "");
  }
else if (TREE_CODE (node) == COMPLEX_TYPE)
  {
--- 723,763 
  }
else if (TREE_CODE (node) == INTEGER_TYPE)
  {
!   if (TYPE_PRECISION (node) == CHAR_TYPE_SIZE)
! pp_string (buffer, (TYPE_UNSIGNED (node)
! ? "unsigned char"
! : "signed char"));
!   else if (TYPE_PRECISION (node) == SHORT_TYPE_SIZE)
!

[Fortran-dev, patch, committed] Minor fixes

2012-03-12 Thread Tobias Burnus
I have committed a fix for one link issue (spurious 
GFC_DESCRIPTOR_STRIDE_BYTES which escaped the renaming to 
GFC_DESCRIPTOR_SM) - and changed "data" to "base_addr" for consistency. 
Rev. 185216.


Additionally, I modified some tree-dump patterns for the extent and for 
the base_addr change.


Result: 192 FAIL lines in 23 test-suite files of which 3 also exist on 
the trunk.



At some point, the extent calculation should be updated. Dumps like the 
following hurt, even if -O1 handles* them:
(((D.1871->dim[0].lower_bound + D.1871->dim[0].extent) + -1) - 
D.1871->dim[0].lower_bound) + 1.
[* maybe -fstrict-overflow and/or -fno-protect-parens is required in 
addition]



Regarding transpose_optimization_2.f90: Here,
atmp.58.dim[0].lbound = 0;
atmp.58.dim[0].ubound = 2;
is replaced by
atmp.58.dim[0].lower_bound = 0;
atmp.58.dim[0].extent = 3 - atmp.58.dim[0].lower_bound;
which increased the number of "atmp" by 2 (for two dims). Also something 
which could be solved in the front end as both lbound and ubound are 
known at compile time.


Tobias
Index: libgfortran/ChangeLog.fortran-dev
===
--- libgfortran/ChangeLog.fortran-dev	(revision 185199)
+++ libgfortran/ChangeLog.fortran-dev	(working copy)
@@ -1,3 +1,8 @@
+2012-03-12  Tobias Burnus  
+
+	* intrinsics/iso_c_binding.c (c_f_pointer_u0): Use
+	GFC_DESCRIPTOR_SM instead of GFC_DESCRIPTOR_STRIDE_BYTES.
+
 2012-03-11  Tobias Burnus  
 
 	* ISO_Fortran_binding.h (CFI_dim_t): Remove stride/ubound,
Index: libgfortran/intrinsics/iso_c_binding.c
===
--- libgfortran/intrinsics/iso_c_binding.c	(revision 185197)
+++ libgfortran/intrinsics/iso_c_binding.c	(working copy)
@@ -103,7 +103,7 @@ ISO_C_BINDING_PREFIX (c_f_pointer_u0) (void *c_ptr
   p = shape->base_addr;
   size = GFC_DESCRIPTOR_SIZE(shape);
 
-  source_stride = GFC_DESCRIPTOR_STRIDE_BYTES(shape,0);
+  source_stride = GFC_DESCRIPTOR_SM(shape,0);
 
   /* shape's length (rank of the output array) */
   shapeSize = GFC_DESCRIPTOR_EXTENT(shape,0);
Index: /home/tob/scratch/fortran-dev/gcc/fortran/trans-types.c
===
--- /home/tob/scratch/fortran-dev/gcc/fortran/trans-types.c	(revision 185199)
+++ /home/tob/scratch/fortran-dev/gcc/fortran/trans-types.c	(working copy)
@@ -1701,7 +1701,7 @@ gfc_get_array_descriptor_base (int dimen, int codi
 
   /* Add the data member as the first element of the descriptor.  */
   decl = gfc_add_field_to_struct_1 (fat_type,
-get_identifier ("data"),
+get_identifier ("base_addr"),
 (restricted
  ? prvoid_type_node
  : ptr_type_node), &chain);
Index: /home/tob/scratch/fortran-dev/gcc/fortran/ChangeLog.fortran-dev
===
--- /home/tob/scratch/fortran-dev/gcc/fortran/ChangeLog.fortran-dev	(revision 185199)
+++ /home/tob/scratch/fortran-dev/gcc/fortran/ChangeLog.fortran-dev	(working copy)
@@ -1,3 +1,8 @@
+2012-03-12  Tobias Burnus  
+
+	* trans-types.c (gfc_get_array_descriptor_base): Rename "data"
+	to "base_addr".
+
 2012-03-11  Tobias Burnus  
 
 	* trans-array.c (UBOUND_SUBFIELD, STRIDE_SUBFIELD): Remove.

Index: gfortran.dg/transpose_optimization_2.f90
===
--- gfortran.dg/transpose_optimization_2.f90	(revision 185197)
+++ gfortran.dg/transpose_optimization_2.f90	(working copy)
@@ -60,7 +60,7 @@
 !
 ! The check below for temporaries gave 14 and 33 for "parm" and "atmp".
 !
-! { dg-final { scan-tree-dump-times "parm" 66 "original" } }
-! { dg-final { scan-tree-dump-times "atmp" 12 "original" } }
+! { dg-final { scan-tree-dump-times "parm" 78 "original" } }
+! { dg-final { scan-tree-dump-times "atmp" 14 "original" } }
 ! { dg-final { cleanup-tree-dump "original" } }
 ! { dg-final { cleanup-modules "mod" } }
Index: gfortran.dg/contiguous_3.f90
===
--- gfortran.dg/contiguous_3.f90	(revision 185197)
+++ gfortran.dg/contiguous_3.f90	(working copy)
@@ -31,10 +31,10 @@
   c2 = d2
 end subroutine t2
 
-! { dg-final { scan-tree-dump-times "= a1->dim.0..stride;" 0 "original" } }
-! { dg-final { scan-tree-dump-times "= b1->dim.0..stride;" 0 "original" } }
-! { dg-final { scan-tree-dump-times "= c2->dim.0..stride;" 1 "original" } }
-! { dg-final { scan-tree-dump-times "= d2->dim.0..stride;" 1 "original" } }
+! { dg-final { scan-tree-dump-times "= a1->dim.0..sm" 0 "original" } }
+! { dg-final { scan-tree-dump-times "= b1->dim.0..sm" 0 "original" } }
+! { dg-final { scan-tree-dump-times "= c2->dim.0..sm /.fl. 4;" 1 "original" } }
+! { dg-final { scan-tree-dump-times "= d2->dim.0..sm /.fl. 4;" 1 "original" } }
 
 
 subroutine test3()
@@ -57,7 +57,7 @@
 end subroutine test3
 
 ! Once for test1 (third call), once for test3 (second call)
-! { dg-final {

Re: [ARM] atomics for rtems, aka bare metal

2012-03-12 Thread Sebastian Huber

Hello Richard,

thank you very much for your implementation.

On 03/09/2012 02:56 AM, Richard Henderson wrote:

On 03/08/12 10:02, Joel Sherrill wrote:

If so, it is just a matter of ifdef's to get the right code.


Ok.


Does arm-eabi have this support? We probably could
just use the same code.


There's scant bare metal support atm.  For sufficiently new ARM core revisions,
gcc will inline operations.  In order to get all of it, you have to target 
ARMv7.

I threw this together today.  It likely needs quite a bit of spit and polish:

[...]

   * This has received only compile testing with the arm-rtemseabi multilibs.
 There may well be bugs.

[...]

I run the test suite with this patch and now the link errors vanish.  I have 
currently no time to test the C++ atomics, but it would be nice if we can use 
this work in GCC 4.7.


=== g++ tests ===

Schedule of variations:
rtems-arm-edb7312

Running target rtems-arm-edb7312
Using /home/sh/rtems-testing/dejagnu/boards/rtems-arm-edb7312.exp as board
description file for target.
Using /usr/share/dejagnu/config/sim.exp as generic interface file for target.
Using /usr/share/dejagnu/baseboards/basic-sim.exp as board description file for
target.
Using /home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/config/default.exp
as tool-and-target-specific interface file.
Running
/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/bprob/bprob.exp ...
Running
/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/charset/charset.exp 
...
Running
/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/compat/compat.exp 
...
Running
/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/compat/struct-layout-1.exp
...
Running
/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/debug/debug.exp ...
FAIL: g++.dg/debug/const1.C -gdwarf-2 -g3 (test for excess errors)
FAIL: g++.dg/debug/const1.C -gdwarf-2 -g3 -O2 (test for excess errors)
FAIL: g++.dg/debug/const1.C -gdwarf-2 -g3 -O3 (test for excess errors)
FAIL: g++.dg/debug/debug4.C -gdwarf-2 -g3 (test for excess errors)
FAIL: g++.dg/debug/debug4.C -gdwarf-2 -g3 -O2 (test for excess errors)
FAIL: g++.dg/debug/debug4.C -gdwarf-2 -g3 -O3 (test for excess errors)
FAIL: g++.dg/debug/pr27657.C -gdwarf-2 -g3 (test for excess errors)
FAIL: g++.dg/debug/pr27657.C -gdwarf-2 -g3 -O2 (test for excess errors)
FAIL: g++.dg/debug/pr27657.C -gdwarf-2 -g3 -O3 (test for excess errors)
FAIL: g++.dg/debug/trivial.C -gdwarf-2 -g3 (test for excess errors)
WARNING: g++.dg/debug/trivial.C -gdwarf-2 -g3 compilation failed to produce
executable
FAIL: g++.dg/debug/trivial.C -gdwarf-2 -g3 -O2 (test for excess errors)
WARNING: g++.dg/debug/trivial.C -gdwarf-2 -g3 -O2 compilation failed to produce
executable
FAIL: g++.dg/debug/trivial.C -gdwarf-2 -g3 -O3 (test for excess errors)
WARNING: g++.dg/debug/trivial.C -gdwarf-2 -g3 -O3 compilation failed to produce
executable
Running
/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/debug/dwarf2/dwarf2.exp
...
Running /home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/dfp/dfp.exp 
...
Running /home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/dg.exp ...
Running
/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/gcov/gcov.exp ...
Running
/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/gomp/gomp.exp ...
Running
/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/graphite/graphite.exp
...
Running
/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/guality/guality.exp 
...
Running /home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/lto/lto.exp 
...
Running /home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/pch/pch.exp 
...
Running
/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/plugin/plugin.exp 
...
Running
/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/simulate-thread/simulate-thread.exp
...
Running
/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/special/ecos.exp ...
Running /home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/tls/tls.exp 
...
Running /home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/tm/tm.exp 
...
Running
/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/torture/dg-torture.exp
...
Running
/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/torture/stackalign/stackalign.exp
...
Running
/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp
...
Running
/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.dg/vect/vect.exp ...
Running
/home/sh/archive/gcc-4.7.0-RC-20120302/gcc/testsuite/g++.old-deja/old-deja.exp 
...

=== g++ Summary ===

# of expected passes 43093
# of unexpected failures 12
# of expected failures 277
# of unsupported tests 738
/home/sh/rtems-testing/gcc/b-arm-gcc/gcc/testsuite/g++/../../g++ version 4.7.0
20120307 (prerelease) (GCC)

--
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax 

Doc: Merge Alpha/VMS and IA-64/VMS options

2012-03-12 Thread Tristan Gingold
Hi,

this patch merges Alpha/VMS and IA-64/VMS options as there is only one .opt for 
them, so there is no need to duplicate the doc.

It also documents -mpointer-size.

Tested by 'make info'

Ok for trunk ?

Tristan.

2012-03-12  Tristan Gingold  

* doc/invoke.texi (VMS Options): Merge Alpha/VMS and IA-64/VMS
Options.  Mention -mpointer-size.

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index a1196f0..2378ba5 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -569,9 +569,6 @@ Objective-C and Objective-C++ Dialects}.
 -msmall-text  -mlarge-text @gol
 -mmemory-latency=@var{time}}
 
-@emph{DEC Alpha/VMS Options}
-@gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
-
 @emph{FR30 Options}
 @gccoptlist{-msmall-model -mno-lsim}
 
@@ -669,9 +666,6 @@ Objective-C and Objective-C++ Dialects}.
 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
 
-@emph{IA-64/VMS Options}
-@gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
-
 @emph{LM32 Options}
 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
 -msign-extend-enabled -muser-enabled}
@@ -946,6 +940,10 @@ See RS/6000 and PowerPC Options.
 @emph{VAX Options}
 @gccoptlist{-mg  -mgnu  -munix}
 
+@emph{VMS Options}
+@gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
+-mpointer-size=@var{size}}
+
 @emph{VxWorks Options}
 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
 -Xbind-lazy  -Xbind-now}
@@ -4816,8 +4814,8 @@ Allow using extensions of later DWARF standard version 
than selected with
 
 @item -gvms
 @opindex gvms
-Produce debugging information in VMS debug format (if that is
-supported).  This is the format used by DEBUG on VMS systems.
+Produce debugging information in Alpha/VMS debug format (if that is
+supported).  This is the format used by DEBUG on Alpha/VMS systems.
 
 @item -g@var{level}
 @itemx -ggdb@var{level}
@@ -10331,7 +10329,6 @@ platform.
 * CR16 Options::
 * Darwin Options::
 * DEC Alpha Options::
-* DEC Alpha/VMS Options::
 * FR30 Options::
 * FRV Options::
 * GNU/Linux Options::
@@ -10340,7 +10337,6 @@ platform.
 * i386 and x86-64 Options::
 * i386 and x86-64 Windows Options::
 * IA-64 Options::
-* IA-64/VMS Options::
 * LM32 Options::
 * M32C Options::
 * M32R/D Options::
@@ -10368,6 +10364,7 @@ platform.
 * TILEPro Options::
 * V850 Options::
 * VAX Options::
+* VMS Options::
 * VxWorks Options::
 * x86-64 Options::
 * Xstormy16 Options::
@@ -12392,27 +12389,6 @@ Note that L3 is only valid for EV5.
 @end table
 @end table
 
-@node DEC Alpha/VMS Options
-@subsection DEC Alpha/VMS Options
-
-These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
-
-@table @gcctabopt
-@item -mvms-return-codes
-@opindex mvms-return-codes
-Return VMS condition codes from main.  The default is to return POSIX
-style condition (e.g.@: error) codes.
-
-@item -mdebug-main=@var{prefix}
-@opindex mdebug-main=@var{prefix}
-Flag the first routine whose name starts with @var{prefix} as the main
-routine for the debugger.
-
-@item -mmalloc64
-@opindex mmalloc64
-Default to 64-bit memory allocation routines.
-@end table
-
 @node FR30 Options
 @subsection FR30 Options
 @cindex FR30 Options
@@ -14325,27 +14301,6 @@ be scheduled.
 
 @end table
 
-@node IA-64/VMS Options
-@subsection IA-64/VMS Options
-
-These @samp{-m} options are defined for the IA-64/VMS implementations:
-
-@table @gcctabopt
-@item -mvms-return-codes
-@opindex mvms-return-codes
-Return VMS condition codes from @code{main}. The default is to return 
POSIX-style
-condition (e.g.@ error) codes.
-
-@item -mdebug-main=@var{prefix}
-@opindex mdebug-main=@var{prefix}
-Flag the first routine whose name starts with @var{prefix} as the main
-routine for the debugger.
-
-@item -mmalloc64
-@opindex mmalloc64
-Default to 64-bit memory allocation routines.
-@end table
-
 @node LM32 Options
 @subsection LM32 Options
 @cindex LM32 options
@@ -18939,6 +18894,34 @@ will assemble with the GNU assembler.
 Output code for G-format floating-point numbers instead of D-format.
 @end table
 
+@node VMS Options
+@subsection VMS Options
+
+These @samp{-m} options are defined for the VMS implementations:
+
+@table @gcctabopt
+@item -mvms-return-codes
+@opindex mvms-return-codes
+Return VMS condition codes from @code{main}. The default is to return 
POSIX-style
+condition (e.g.@ error) codes.
+
+@item -mdebug-main=@var{prefix}
+@opindex mdebug-main=@var{prefix}
+Flag the first routine whose name starts with @var{prefix} as the main
+routine for the debugger.
+
+@item -mmalloc64
+@opindex mmalloc64
+Default to 64-bit memory allocation routines.
+
+@item -mpointer-size=@var{size}
+@opindex -mpointer-size=@var{size}
+Set the default size of pointers. Possible options for @var{size} are
+@samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
+for 64 bit pointers, and @samp{no} for supp

Re: Doc: Merge Alpha/VMS and IA-64/VMS options

2012-03-12 Thread Richard Guenther
On Mon, Mar 12, 2012 at 2:00 PM, Tristan Gingold  wrote:
> Hi,
>
> this patch merges Alpha/VMS and IA-64/VMS options as there is only one .opt 
> for them, so there is no need to duplicate the doc.
>
> It also documents -mpointer-size.
>
> Tested by 'make info'
>
> Ok for trunk ?

Ok.

Thanks,
Richard.

> Tristan.
>
> 2012-03-12  Tristan Gingold  
>
>        * doc/invoke.texi (VMS Options): Merge Alpha/VMS and IA-64/VMS
>        Options.  Mention -mpointer-size.
>
> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
> index a1196f0..2378ba5 100644
> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> @@ -569,9 +569,6 @@ Objective-C and Objective-C++ Dialects}.
>  -msmall-text  -mlarge-text @gol
>  -mmemory-latency=@var{time}}
>
> -@emph{DEC Alpha/VMS Options}
> -@gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
> -
>  @emph{FR30 Options}
>  @gccoptlist{-msmall-model -mno-lsim}
>
> @@ -669,9 +666,6 @@ Objective-C and Objective-C++ Dialects}.
>  -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
>  -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
>
> -@emph{IA-64/VMS Options}
> -@gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
> -
>  @emph{LM32 Options}
>  @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
>  -msign-extend-enabled -muser-enabled}
> @@ -946,6 +940,10 @@ See RS/6000 and PowerPC Options.
>  @emph{VAX Options}
>  @gccoptlist{-mg  -mgnu  -munix}
>
> +@emph{VMS Options}
> +@gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
> +-mpointer-size=@var{size}}
> +
>  @emph{VxWorks Options}
>  @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
>  -Xbind-lazy  -Xbind-now}
> @@ -4816,8 +4814,8 @@ Allow using extensions of later DWARF standard version 
> than selected with
>
>  @item -gvms
>  @opindex gvms
> -Produce debugging information in VMS debug format (if that is
> -supported).  This is the format used by DEBUG on VMS systems.
> +Produce debugging information in Alpha/VMS debug format (if that is
> +supported).  This is the format used by DEBUG on Alpha/VMS systems.
>
>  @item -g@var{level}
>  @itemx -ggdb@var{level}
> @@ -10331,7 +10329,6 @@ platform.
>  * CR16 Options::
>  * Darwin Options::
>  * DEC Alpha Options::
> -* DEC Alpha/VMS Options::
>  * FR30 Options::
>  * FRV Options::
>  * GNU/Linux Options::
> @@ -10340,7 +10337,6 @@ platform.
>  * i386 and x86-64 Options::
>  * i386 and x86-64 Windows Options::
>  * IA-64 Options::
> -* IA-64/VMS Options::
>  * LM32 Options::
>  * M32C Options::
>  * M32R/D Options::
> @@ -10368,6 +10364,7 @@ platform.
>  * TILEPro Options::
>  * V850 Options::
>  * VAX Options::
> +* VMS Options::
>  * VxWorks Options::
>  * x86-64 Options::
>  * Xstormy16 Options::
> @@ -12392,27 +12389,6 @@ Note that L3 is only valid for EV5.
>  @end table
>  @end table
>
> -@node DEC Alpha/VMS Options
> -@subsection DEC Alpha/VMS Options
> -
> -These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
> -
> -@table @gcctabopt
> -@item -mvms-return-codes
> -@opindex mvms-return-codes
> -Return VMS condition codes from main.  The default is to return POSIX
> -style condition (e.g.@: error) codes.
> -
> -@item -mdebug-main=@var{prefix}
> -@opindex mdebug-main=@var{prefix}
> -Flag the first routine whose name starts with @var{prefix} as the main
> -routine for the debugger.
> -
> -@item -mmalloc64
> -@opindex mmalloc64
> -Default to 64-bit memory allocation routines.
> -@end table
> -
>  @node FR30 Options
>  @subsection FR30 Options
>  @cindex FR30 Options
> @@ -14325,27 +14301,6 @@ be scheduled.
>
>  @end table
>
> -@node IA-64/VMS Options
> -@subsection IA-64/VMS Options
> -
> -These @samp{-m} options are defined for the IA-64/VMS implementations:
> -
> -@table @gcctabopt
> -@item -mvms-return-codes
> -@opindex mvms-return-codes
> -Return VMS condition codes from @code{main}. The default is to return 
> POSIX-style
> -condition (e.g.@ error) codes.
> -
> -@item -mdebug-main=@var{prefix}
> -@opindex mdebug-main=@var{prefix}
> -Flag the first routine whose name starts with @var{prefix} as the main
> -routine for the debugger.
> -
> -@item -mmalloc64
> -@opindex mmalloc64
> -Default to 64-bit memory allocation routines.
> -@end table
> -
>  @node LM32 Options
>  @subsection LM32 Options
>  @cindex LM32 options
> @@ -18939,6 +18894,34 @@ will assemble with the GNU assembler.
>  Output code for G-format floating-point numbers instead of D-format.
>  @end table
>
> +@node VMS Options
> +@subsection VMS Options
> +
> +These @samp{-m} options are defined for the VMS implementations:
> +
> +@table @gcctabopt
> +@item -mvms-return-codes
> +@opindex mvms-return-codes
> +Return VMS condition codes from @code{main}. The default is to return 
> POSIX-style
> +condition (e.g.@ error) codes.
> +
> +@item -mdebug-main=@var{prefix}
> +@opindex mdebug-main=@var{prefix}
> +Flag the first routine whose name starts with @var{prefix} as the

Re: [Fortran-dev, patch, committed] Minor fixes

2012-03-12 Thread Paul Richard Thomas
Dear Tobias,


> At some point, the extent calculation should be updated. Dumps like the
> following hurt, even if -O1 handles* them:
> (((D.1871->dim[0].lower_bound + D.1871->dim[0].extent) + -1) -
> D.1871->dim[0].lower_bound) + 1.
> [* maybe -fstrict-overflow and/or -fno-protect-parens is required in
> addition]

It was always the intention that the temporary API, which translates
the present representation to the new, should be replaced in places
where inefficient code is generated.

Well done - you are making good progress on the first stage of
changing the array descriptor.  The next stage should be to get rid of
the inefficiencies such as that above.  Then we can add all the new
fields out side of the dimension array.

Cheers

Paul


[v3] libstdc++/52562

2012-03-12 Thread Paolo Carlini

Hi,

barring unexpected issues in mainline will go in 4.7.1 too.

Tested x86_64-linux.

Thanks,
Paolo.

///
2012-03-12  Paolo Carlini  

PR libstdc++/52562
* libsupc++/typeinfo (type_info::name, before, operator==,
operator!=): Mark noexcept in C++11 mode.
* libsupc++/tinfo.cc (type_info::operator==): Adjust.
* libsupc++/tinfo2.cc (type_info::before): Likewise.
* testsuite/18_support/type_info/52562.cc: New.

Index: libsupc++/tinfo2.cc
===
--- libsupc++/tinfo2.cc (revision 185225)
+++ libsupc++/tinfo2.cc (working copy)
@@ -1,6 +1,7 @@
 // Methods for type_info for -*- C++ -*- Run Time Type Identification.
 
-// Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2009
+// Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2009,
+// 2012
 // Free Software Foundation
 //
 // This file is part of GCC.
@@ -32,7 +33,7 @@
 #if !__GXX_TYPEINFO_EQUALITY_INLINE
 
 bool
-type_info::before (const type_info &arg) const
+type_info::before (const type_info &arg) const _GLIBCXX_NOEXCEPT
 {
 #if __GXX_MERGED_TYPEINFO_NAMES
   return name () < arg.name ();
Index: libsupc++/tinfo.cc
===
--- libsupc++/tinfo.cc  (revision 185225)
+++ libsupc++/tinfo.cc  (working copy)
@@ -1,6 +1,6 @@
 // Methods for type_info for -*- C++ -*- Run Time Type Identification.
 // Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-// 2003, 2004, 2005, 2006, 2007, 2009
+// 2003, 2004, 2005, 2006, 2007, 2009, 2012
 // Free Software Foundation
 //
 // This file is part of GCC.
@@ -36,7 +36,7 @@
 
 // We can't rely on common symbols being shared between shared objects.
 bool std::type_info::
-operator== (const std::type_info& arg) const
+operator== (const std::type_info& arg) const _GLIBCXX_NOEXCEPT
 {
 #if __GXX_MERGED_TYPEINFO_NAMES
   return name () == arg.name ();
Index: libsupc++/typeinfo
===
--- libsupc++/typeinfo  (revision 185225)
+++ libsupc++/typeinfo  (working copy)
@@ -98,15 +98,15 @@
 
 /** Returns an @e implementation-defined byte string; this is not
  *  portable between compilers!  */
-const char* name() const
+const char* name() const _GLIBCXX_NOEXCEPT
 { return __name[0] == '*' ? __name + 1 : __name; }
 
 #if !__GXX_TYPEINFO_EQUALITY_INLINE
 // In old abi, or when weak symbols are not supported, there can
 // be multiple instances of a type_info object for one
 // type. Uniqueness must use the _name value, not object address.
-bool before(const type_info& __arg) const;
-bool operator==(const type_info& __arg) const;
+bool before(const type_info& __arg) const _GLIBCXX_NOEXCEPT;
+bool operator==(const type_info& __arg) const _GLIBCXX_NOEXCEPT;
 #else
   #if !__GXX_MERGED_TYPEINFO_NAMES
 /** Returns true if @c *this precedes @c __arg in the implementation's
@@ -114,12 +114,12 @@
 // Even with the new abi, on systems that support dlopen
 // we can run into cases where type_info names aren't merged,
 // so we still need to do string comparison.
-bool before(const type_info& __arg) const
+bool before(const type_info& __arg) const _GLIBCXX_NOEXCEPT
 { return (__name[0] == '*' && __arg.__name[0] == '*')
? __name < __arg.__name
: __builtin_strcmp (__name, __arg.__name) < 0; }
 
-bool operator==(const type_info& __arg) const
+bool operator==(const type_info& __arg) const _GLIBCXX_NOEXCEPT
 {
   return ((__name == __arg.__name)
  || (__name[0] != '*' &&
@@ -128,14 +128,14 @@
   #else
 // On some targets we can rely on type_info's NTBS being unique,
 // and therefore address comparisons are sufficient.
-bool before(const type_info& __arg) const
+bool before(const type_info& __arg) const _GLIBCXX_NOEXCEPT
 { return __name < __arg.__name; }
 
-bool operator==(const type_info& __arg) const
+bool operator==(const type_info& __arg) const _GLIBCXX_NOEXCEPT
 { return __name == __arg.__name; }
   #endif
 #endif
-bool operator!=(const type_info& __arg) const
+bool operator!=(const type_info& __arg) const _GLIBCXX_NOEXCEPT
 { return !operator==(__arg); }
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
Index: testsuite/18_support/type_info/52562.cc
===
--- testsuite/18_support/type_info/52562.cc (revision 0)
+++ testsuite/18_support/type_info/52562.cc (revision 0)
@@ -0,0 +1,30 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2012 Free Software Foundation
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at

Re: [patch, RFA] delete obsolete -madjust-unroll option for SH

2012-03-12 Thread Kaz Kojima
Hi,

Richard Guenther  wrote:
> On Sat, Mar 10, 2012 at 5:25 AM, Sandra Loosemore
>  wrote:
>> When I was working on cleanups to invoke.texi I noticed this bit in the
>> SH Options section:
>>
>> @item -madjust-unroll
>> @opindex madjust-unroll
>> Throttle unrolling to avoid thrashing target registers.
>> This option only has an effect if the GCC code base supports the
>> TARGET_ADJUST_UNROLL_MAX target hook.
>>
>> Well, the current manual is supposed to document what the current GCC
>> code base does, so I looked up this target hook and found it was deleted
>> in 2007 with a ChangeLog note that it has been dead since gcc 4.0.0.
>> However the command-line option is still present. ,A (B:-S
>>
>> Any reason why we should not delete this entirely, per the attached patch?
>> I haven't built/tested this (except for the manual) but can do that if the
>> patch isn't sufficiently obvious.
> 
> Command-line options have to be preserved for backward-compatibility
> so old makefiles do not fail.  Though the entry in the .opt file should match
> 
> madjust-unroll
> Target Ignore
> Does nothing. Preserved for backward compatibility.
> 
> The documentation can be removed, of course.

The patch is OK with the change suggested by Richard.
Thanks!

Regards,
kaz


Re: [Patch]: Add include hacks for VMS headers

2012-03-12 Thread Bruce Korb
On Mon, Mar 12, 2012 at 3:05 AM, Tristan Gingold  wrote:
> Hi,
>
> this patch adds a few fix include entries for VMS so that:

[things work]

Looks good to me.


Re: [PATCH 07/10] addr32: Use word_mode instead of Pmode in loop expand

2012-03-12 Thread Jan Hubicka
> On Sun, Mar 11, 2012 at 2:06 AM, H.J. Lu  wrote:
> > On Thu, Mar 8, 2012 at 3:22 AM, Uros Bizjak  wrote:
> >> On Fri, Mar 2, 2012 at 10:02 PM, H.J. Lu  wrote:
> >>
> >>> This patches uses word_mode instead of Pmode in loop expand since
> >>> word_mode may have bigger size than Pmode.  OK for trunk?
> >>>
> >>> Thanks.
> >>>
> >>> H.J.
> >>> ---
> >>> 2012-03-02  H.J. Lu  
> >>>
> >>>        * config/i386/i386.c (ix86_expand_movmem): Use word_mode instead
> >>>        of Pmode on loop.
> >>>        (ix86_expand_setmem): Likwise.
> >>
> >> Jan, can you please comment on the changes in this patch?
> >>
> >
> > Here is a complete updated patch to use word_mode in ix86_expand_movmem
> > and ix86_expand_setmem.  It also fixes ix86_zero_extend_to_Pmode to handle
> > Pmode != DImode.  OK for trunk?
> 
> Please rewrite ix86_zero_extend_to_Pmode to something like:
>   rtx tmp;
>   if (GET_MODE (exp) != Pmode)
> tmp = convert_to_mode (Pmode, exp, 1);
>   return force_reg (Pmode, tmp));

Yes, the patch looks OK with this change.

Thanks,
Honza


[PATCH] More type_for_size call removals

2012-03-12 Thread Richard Guenther

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied as
obvious.

Richard.

2012-03-12  Richard Guenther  

lto/
* lto-lang.c (builtin_type_for_size): Use lto_type_for_size.

fortran/
* f95-lang.c (builtin_type_for_size): Use gfc_type_for_size.

c-common/
* c-common.c (c_common_get_narrower): Use c_common_type_for_size.
(builtin_type_for_size): Likewise.

* config/alpha/alpha.c (alpha_gimplify_va_arg): Use
build_nonstandard_integer_type.

Index: gcc/lto/lto-lang.c
===
*** gcc/lto/lto-lang.c  (revision 185226)
--- gcc/lto/lto-lang.c  (working copy)
*** along with GCC; see the file COPYING3.
*** 36,41 
--- 36,43 
  #include "toplev.h"
  #include "lto-streamer.h"
  
+ static tree lto_type_for_size (unsigned, int);
+ 
  static tree handle_noreturn_attribute (tree *, tree, tree, int, bool *);
  static tree handle_leaf_attribute (tree *, tree, tree, int, bool *);
  static tree handle_const_attribute (tree *, tree, tree, int, bool *);
*** def_fn_type (builtin_type def, builtin_t
*** 523,529 
  static tree
  builtin_type_for_size (int size, bool unsignedp)
  {
!   tree type = lang_hooks.types.type_for_size (size, unsignedp);
return type ? type : error_mark_node;
  }
  
--- 525,531 
  static tree
  builtin_type_for_size (int size, bool unsignedp)
  {
!   tree type = lto_type_for_size (size, unsignedp);
return type ? type : error_mark_node;
  }
  
Index: gcc/fortran/f95-lang.c
===
*** gcc/fortran/f95-lang.c  (revision 185226)
--- gcc/fortran/f95-lang.c  (working copy)
*** build_builtin_fntypes (tree *fntype, tre
*** 605,611 
  static tree
  builtin_type_for_size (int size, bool unsignedp)
  {
!   tree type = lang_hooks.types.type_for_size (size, unsignedp);
return type ? type : error_mark_node;
  }
  
--- 605,611 
  static tree
  builtin_type_for_size (int size, bool unsignedp)
  {
!   tree type = gfc_type_for_size (size, unsignedp);
return type ? type : error_mark_node;
  }
  
Index: gcc/c-family/c-common.c
===
*** gcc/c-family/c-common.c (revision 185226)
--- gcc/c-family/c-common.c (working copy)
*** c_common_get_narrower (tree op, int *uns
*** 1849,1857 
/* C++0x scoped enumerations don't implicitly convert to integral
 type; if we stripped an explicit conversion to a larger type we
 need to replace it so common_type will still work.  */
!   tree type = (lang_hooks.types.type_for_size
!  (TYPE_PRECISION (TREE_TYPE (op)),
!   TYPE_UNSIGNED (TREE_TYPE (op;
op = fold_convert (type, op);
  }
return op;
--- 1849,1856 
/* C++0x scoped enumerations don't implicitly convert to integral
 type; if we stripped an explicit conversion to a larger type we
 need to replace it so common_type will still work.  */
!   tree type = c_common_type_for_size (TYPE_PRECISION (TREE_TYPE (op)),
! TYPE_UNSIGNED (TREE_TYPE (op)));
op = fold_convert (type, op);
  }
return op;
*** c_common_mark_addressable_vec (tree t)
*** 9259,9265 
  tree
  builtin_type_for_size (int size, bool unsignedp)
  {
!   tree type = lang_hooks.types.type_for_size (size, unsignedp);
return type ? type : error_mark_node;
  }
  
--- 9258,9264 
  tree
  builtin_type_for_size (int size, bool unsignedp)
  {
!   tree type = c_common_type_for_size (size, unsignedp);
return type ? type : error_mark_node;
  }
  
Index: gcc/config/alpha/alpha.c
===
*** gcc/config/alpha/alpha.c(revision 185226)
--- gcc/config/alpha/alpha.c(working copy)
*** alpha_gimplify_va_arg (tree valist, tree
*** 6228,6234 
   offset field so that it's the proper width for pointer arithmetic.  */
base = get_formal_tmp_var (base_field, pre_p);
  
!   t = fold_convert (lang_hooks.types.type_for_size (64, 0), offset_field);
offset = get_initialized_tmp_var (t, pre_p, NULL);
  
indirect = pass_by_reference (NULL, TYPE_MODE (type), type, false);
--- 6228,6234 
   offset field so that it's the proper width for pointer arithmetic.  */
base = get_formal_tmp_var (base_field, pre_p);
  
!   t = fold_convert (build_nonstandard_integer_type (64, 0), offset_field);
offset = get_initialized_tmp_var (t, pre_p, NULL);
  
indirect = pass_by_reference (NULL, TYPE_MODE (type), type, false);


[PATCH 0/3] Fixing expansion of misaligned MEM_REFs on strict-alignment targets

2012-03-12 Thread Martin Jambor
Hi,

this is another iteration of my effort to fix expansion of misaligned
memory accesses on strict-alignment platforms (which was suggested by
Richi in http://gcc.gnu.org/ml/gcc-patches/2011-08/msg00931.html, my
previous attempt was posted as
http://gcc.gnu.org/ml/gcc-patches/2012-02/msg01378.html).

Most importantly, I realized that the previous second patch was wrong
because store_field, which is called in the same code path, itself
calls store_bit_field just as I would.  This then lead to unnecessary
tripling of the code handling misalignment in some cases.  The only
problem with removing it was that this code path calls expand_normal
to expand the base of the MEM_REF and that means the third patch to
expand_expr_real_1 kicks in, extracts the value into a register which
is returned to expand_assignment, the existing code then writes the
value to a register but never stores it into memory.

I came to conclusion that in this case expand_assignment should expand
the MEM_REF itself rather passing it to expand_normal, just as it
already does when expanding naked MEM_REF and introduced a new second
patch doing just that.  Because very similar code would now be twice
in expand_assignment and once in expand_expr_real_1, I introduced a
new function expanding it in all of these three cases (more details on
that in the email with the actual patch).

I have successfully bootstrapped the first patch and all three patches
combined patch on x86_64-linux, i686-linux, ia64-linux (without Ada)
and sparc64-linux (without Java).  I will test the second on its own
too, I have just not done that yet.

Thanks in advance for any comments,

Martin


[PATCH 1/3] Misaligned top level MEM_REFs on LHS of assignments

2012-03-12 Thread Martin Jambor
Hi,

this patch has not changed since I posted it the last time
(http://gcc.gnu.org/ml/gcc-patches/2012-02/msg01375.html) except for a
fixed formatting of a comment.  It has been already approved by Richi
(http://gcc.gnu.org/ml/gcc-patches/2012-02/msg01389.html) and I intend
to commit it this week even if the other patches still undergo review.

Thanks,

Martin

2012-03-08  Martin Jambor  

* expr.c (expand_assignment): Handle misaligned scalar writes to
memory through top-level MEM_REFs by calling store_bit_field.

* testsuite/gcc.dg/misaligned-expand-2.c: New test.


Index: src/gcc/expr.c
===
--- src.orig/gcc/expr.c
+++ src/gcc/expr.c
@@ -4593,10 +4593,12 @@ expand_assignment (tree to, tree from, b
   if ((TREE_CODE (to) == MEM_REF
|| TREE_CODE (to) == TARGET_MEM_REF)
   && mode != BLKmode
+  && !mem_ref_refers_to_non_mem_p (to)
   && ((align = get_object_or_type_alignment (to))
  < GET_MODE_ALIGNMENT (mode))
-  && ((icode = optab_handler (movmisalign_optab, mode))
- != CODE_FOR_nothing))
+  && (((icode = optab_handler (movmisalign_optab, mode))
+  != CODE_FOR_nothing)
+ || SLOW_UNALIGNED_ACCESS (mode, align)))
 {
   addr_space_t as
= TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (to, 0;
@@ -4639,11 +4641,17 @@ expand_assignment (tree to, tree from, b
   if (TREE_THIS_VOLATILE (to))
MEM_VOLATILE_P (mem) = 1;
 
-  create_fixed_operand (&ops[0], mem);
-  create_input_operand (&ops[1], reg, mode);
-  /* The movmisalign pattern cannot fail, else the assignment would
-silently be omitted.  */
-  expand_insn (icode, 2, ops);
+  if (icode != CODE_FOR_nothing)
+   {
+ create_fixed_operand (&ops[0], mem);
+ create_input_operand (&ops[1], reg, mode);
+ /* The movmisalign pattern cannot fail, else the assignment
+would silently be omitted.  */
+ expand_insn (icode, 2, ops);
+   }
+  else
+   store_bit_field (mem, GET_MODE_BITSIZE (mode),
+0, 0, 0, mode, reg);
   return;
 }
 
Index: src/gcc/testsuite/gcc.dg/misaligned-expand-2.c
===
--- /dev/null
+++ src/gcc/testsuite/gcc.dg/misaligned-expand-2.c
@@ -0,0 +1,42 @@
+/* Test that expand can generate correct stores to misaligned data even on
+   strict alignment platforms.  */
+
+/* { dg-do run } */
+/* { dg-options "-O0" } */
+
+extern void abort ();
+
+typedef unsigned int myint __attribute__((aligned(1)));
+
+void
+foo (myint *p, unsigned int i)
+{
+  *p = i;
+}
+
+#define cst 0xdeadbeef
+#define NUM 8
+
+struct blah
+{
+  char c;
+  myint i[NUM];
+};
+
+struct blah g;
+
+#define cst 0xdeadbeef
+
+int
+main (int argc, char **argv)
+{
+  int k;
+
+  for (k = 0; k < NUM; k++)
+{
+  foo (&g.i[k], cst);
+  if (g.i[k] != cst)
+   abort ();
+}
+  return 0;
+}



[PATCH 3/3] Misaligned MEM_REF reads

2012-03-12 Thread Martin Jambor
Hi,

this patch is very similar to the one I posted before
(http://gcc.gnu.org/ml/gcc-patches/2012-02/msg01377.html) except that
it is now adjusted to sit on top of the new one before this and does
not ignore complex numbers.

There are more movmisalign_optab generations in this function.  There
is the TARGET_MEM_REF case which I intend to piggy-back on in the same
way like MEM_REF is handled in this patch once it leaves the RFC
stage.  Finally, movmisalign_optab is also generated in
VIEW_CONVERT_EXPR case but as far as I understand the code, misaligned
loads are already handled there (only perhaps we should use
SLOW_UNALIGNED_ACCESS instead of STRICT_ALIGNMENT there?).

The three patches passed bootstrap and testing on x86_64-linux,
i686-linux, usparc64-linux (without Java) and ia64-linux (without
Ada).  I propose to commit it after the previous patch passes review.

Thanks,

Martin


2012-03-09  Martin Jambor  

* expr.c (expand_expr_real_1): handle misaligned scalar reads from
memory through MEM_REFs by calling extract_bit_field.

* testsuite/gcc.dg/misaligned-expand-1.c: New test.


Index: src/gcc/expr.c
===
--- src.orig/gcc/expr.c
+++ src/gcc/expr.c
@@ -9404,21 +9404,27 @@ expand_expr_real_1 (tree exp, rtx target
set_mem_addr_space (temp, as);
align = get_object_or_type_alignment (exp);
if (mode != BLKmode
-   && align < GET_MODE_ALIGNMENT (mode)
-   /* If the target does not have special handling for unaligned
-  loads of mode then it can use regular moves for them.  */
-   && ((icode = optab_handler (movmisalign_optab, mode))
-   != CODE_FOR_nothing))
+   && align < GET_MODE_ALIGNMENT (mode))
  {
-   struct expand_operand ops[2];
+   if ((icode = optab_handler (movmisalign_optab, mode))
+   != CODE_FOR_nothing)
+ {
+   struct expand_operand ops[2];
 
-   /* We've already validated the memory, and we're creating a
-  new pseudo destination.  The predicates really can't fail,
-  nor can the generator.  */
-   create_output_operand (&ops[0], NULL_RTX, mode);
-   create_fixed_operand (&ops[1], temp);
-   expand_insn (icode, 2, ops);
-   return ops[0].value;
+   /* We've already validated the memory, and we're creating a
+  new pseudo destination.  The predicates really can't fail,
+  nor can the generator.  */
+   create_output_operand (&ops[0], NULL_RTX, mode);
+   create_fixed_operand (&ops[1], temp);
+   expand_insn (icode, 2, ops);
+   return ops[0].value;
+ }
+   else if (SLOW_UNALIGNED_ACCESS (mode, align))
+ temp = extract_bit_field (temp, GET_MODE_BITSIZE (mode),
+   0, TYPE_UNSIGNED (TREE_TYPE (exp)),
+   true, (modifier == EXPAND_STACK_PARM
+  ? NULL_RTX : target),
+   mode, mode);
  }
return temp;
   }
Index: src/gcc/testsuite/gcc.dg/misaligned-expand-1.c
===
--- /dev/null
+++ src/gcc/testsuite/gcc.dg/misaligned-expand-1.c
@@ -0,0 +1,41 @@
+/* Test that expand can generate correct loads of misaligned data even on
+   strict alignment platforms.  */
+
+/* { dg-do run } */
+/* { dg-options "-O0" } */
+
+extern void abort ();
+
+typedef unsigned int myint __attribute__((aligned(1)));
+
+unsigned int
+foo (myint *p)
+{
+  return *p;
+}
+
+#define cst 0xdeadbeef
+#define NUM 8
+
+struct blah
+{
+  char c;
+  myint i[NUM];
+};
+
+struct blah g;
+
+int
+main (int argc, char **argv)
+{
+  int i, k;
+  for (k = 0; k < NUM; k++)
+{
+  g.i[k] = cst;
+  i = foo (&g.i[k]);
+
+  if (i != cst)
+   abort ();
+}
+  return 0;
+}
Index: src/gcc/testsuite/gcc.dg/misaligned-expand-3.c
===
--- /dev/null
+++ src/gcc/testsuite/gcc.dg/misaligned-expand-3.c
@@ -0,0 +1,43 @@
+/* Test that expand can generate correct stores to misaligned data of complex
+   type even on strict alignment platforms.  */
+
+/* { dg-do run } */
+/* { dg-options "-O0" } */
+
+extern void abort ();
+
+typedef _Complex float mycmplx __attribute__((aligned(1)));
+
+void
+foo (mycmplx *p, float r, float i)
+{
+  __real__ *p = r;
+  __imag__ *p = i;
+}
+
+#define cvr 3.2f
+#define cvi 2.5f
+#define NUM 8
+
+struct blah
+{
+  char c;
+  mycmplx x[NUM];
+} __attribute__((packed));
+
+struct blah g;
+
+int
+main (int argc, char **argv)
+{
+  int k;
+
+  for (k = 0; k < NUM; k++)
+{
+  foo (&g.x[k], cvr, cvi);
+  if (__real__ g.x[k] != cvr
+ || __imag__ g.x[k] != cvi)
+   abort ();
+}
+  return 0;

[PATCH 2/3] Move MEM_REF expansion to a new function

2012-03-12 Thread Martin Jambor
Hi,

when we expand a misaligned MEM_REF on the LHS, we must not call the
code in expand_expr_real_1 if the subsequent patch is applied, because
the code generates code extracting the contents of the memory to a
register, which is of course bad if the intent is to write into that
memory.  Therefore expand_assignment should expand MEM_REFs itself,
just as it do when it encounters naked misaligned ones.

In order not to have nearly identical code twice in expand_assignment
and once more in expand_expr_real_1, I put it into a separate function
expand_mem_ref_to_mem_rtx (I'll be happy to change the name to
anything more correct or fitting).  Nevertheless, the existing code
pieces in expand_assignment and expand_expr_real_1 sre not exactly
identical, the differences are:

- expand_expr_real_1 handles a special case when the defining
  statement of the MEM_REF base is a BIT_AND_EXPR, expand_assignment
  does not.  The changelog introducing the change says "TER
  BIT_AND_EXPRs into MEM_REFs" which I suspect is a good thing for
  LHSs as well, so I kept the code.

- When expanding the base, the two functions differ in the
  expand_modifier they pass down to expand_expr.  expand_assignment
  uses EXPAND_NORMAL while expand_expr_real_1 passes EXPAND_SUM.
  According to the comment in expr.h the latter seemed more permissive
  and so I used that, even though I admit I do not really know what
  the implications of this modifier are.  Is it OK to use EXPAND_SUM
  also on a LHS?

- expand_expr_real_1 calls memory_address_addr_space twice, whereas
  expand_assignment replaces the first call with
  convert_memory_address_addr_space.  Looking at the two functions I
  thought it might be OK to call memory_address_addr_space (which
  itself calls convert_memory_address_addr_space) only once.
  But again, my expertise in this area is limited, I'll be happy to be
  shown I'm wrong here.

So far I have bootstrapped and tested this patch separately on
x86_64-linx and i686-linux.  Additionally, it has also passed
bootstrap and testing on usparc64-linux and ia64-linux.

Thanks in advance for any comments,

Martin


2012-03-09  Martin Jambor  

* expr.c (expand_mem_ref_to_mem_rtx): New function.
(expand_assignment): Call it when expanding a MEM_REF on the LHS.
(expand_expr_real_1): Likewise.

Index: src/gcc/expr.c
===
--- src.orig/gcc/expr.c
+++ src/gcc/expr.c
@@ -4565,6 +4565,47 @@ mem_ref_refers_to_non_mem_p (tree ref)
  && !MEM_P (DECL_RTL (base)));
 }
 
+/* Expand a MEM_REF referring an object in memory to a MEM RTX.  Any spacial
+   treatment of misalignment must be handled on top of the returned result.  */
+
+static rtx
+expand_mem_ref_to_mem_rtx (tree ref)
+{
+  enum machine_mode address_mode, mode = TYPE_MODE (TREE_TYPE (ref));
+  tree base = TREE_OPERAND (ref, 0);
+  addr_space_t as
+= TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (ref, 0;
+  gimple def_stmt;
+  rtx mem, op0;
+
+  gcc_checking_assert (!mem_ref_refers_to_non_mem_p (ref));
+
+  address_mode = targetm.addr_space.address_mode (as);
+
+  if ((def_stmt = get_def_for_expr (base, BIT_AND_EXPR)))
+{
+  tree mask = gimple_assign_rhs2 (def_stmt);
+  base = build2 (BIT_AND_EXPR, TREE_TYPE (base),
+gimple_assign_rhs1 (def_stmt), mask);
+  TREE_OPERAND (ref, 0) = base;
+}
+  op0 = expand_expr (base, NULL_RTX, VOIDmode, EXPAND_SUM);
+  op0 = convert_memory_address_addr_space (address_mode, op0, as);
+  if (!integer_zerop (TREE_OPERAND (ref, 1)))
+{
+  rtx off
+= immed_double_int_const (mem_ref_offset (ref), address_mode);
+  op0 = simplify_gen_binary (PLUS, address_mode, op0, off);
+}
+  op0 = memory_address_addr_space (mode, op0, as);
+  mem = gen_rtx_MEM (mode, op0);
+  set_mem_attributes (mem, ref, 0);
+  set_mem_addr_space (mem, as);
+  if (TREE_THIS_VOLATILE (ref))
+MEM_VOLATILE_P (mem) = 1;
+  return mem;
+}
+
 /* Expand an assignment that stores the value of FROM into TO.  If NONTEMPORAL
is true, try generating a nontemporal store.  */
 
@@ -4600,46 +4641,31 @@ expand_assignment (tree to, tree from, b
   != CODE_FOR_nothing)
  || SLOW_UNALIGNED_ACCESS (mode, align)))
 {
-  addr_space_t as
-   = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (to, 0;
   struct expand_operand ops[2];
-  enum machine_mode address_mode;
-  rtx reg, op0, mem;
+  rtx reg, mem;
 
   reg = expand_expr (from, NULL_RTX, VOIDmode, EXPAND_NORMAL);
   reg = force_not_mem (reg);
 
   if (TREE_CODE (to) == MEM_REF)
-   {
- tree base = TREE_OPERAND (to, 0);
- address_mode = targetm.addr_space.address_mode (as);
- op0 = expand_expr (base, NULL_RTX, VOIDmode, EXPAND_NORMAL);
- op0 = convert_memory_address_addr_space (address_mode, op0, as);
- if (!integer_zerop (TREE_OPERAND (to, 1)))
-   {
- 

Re: [VMS/committed]: Add -mpointer-size switch

2012-03-12 Thread Douglas Rupp

On 3/12/2012 4:48 AM, Tristan Gingold wrote:

Hi,

Now that '#pragma pointer_size' is supported by GCC for VMS, we can add the 
'-mpointer-size' switch (modeled on /POINTER_SIZE=xx DEC-C qualifier) to set 
the default pointer size.  This also makes alpha64-dec-*vms* target obsolete 
(but still supported by alpha*-dec-*vms*).



What about the size of Ada system.address which is also controlled by 
alpha64 triplet?


Re: [VMS/committed]: Add -mpointer-size switch

2012-03-12 Thread Tristan Gingold

On Mar 12, 2012, at 3:14 PM, Douglas Rupp wrote:

> On 3/12/2012 4:48 AM, Tristan Gingold wrote:
>> Hi,
>> 
>> Now that '#pragma pointer_size' is supported by GCC for VMS, we can add the 
>> '-mpointer-size' switch (modeled on /POINTER_SIZE=xx DEC-C qualifier) to set 
>> the default pointer size.  This also makes alpha64-dec-*vms* target obsolete 
>> (but still supported by alpha*-dec-*vms*).
>> 
> 
> What about the size of Ada system.address which is also controlled by alpha64 
> triplet?

You should need to configure as alpha64-dec-openvms.  But indeed, I think we 
should always default to 64 for Ada.

Tristan.




Re: [Patch]: Add include hacks for VMS headers

2012-03-12 Thread Tristan Gingold

On Mar 12, 2012, at 3:00 PM, Bruce Korb wrote:

> On Mon, Mar 12, 2012 at 3:05 AM, Tristan Gingold  wrote:
>> Hi,
>> 
>> this patch adds a few fix include entries for VMS so that:
> 
> [things work]
> 
> Looks good to me.

Thank you, now committed.

Tristan.




Re: [PATCH] Fix PR49484, gthr requirements update (target maintainers have a looksee)

2012-03-12 Thread Richard Guenther
On Mon, Mar 5, 2012 at 1:17 PM, Richard Guenther
 wrote:
> On Wed, Jan 18, 2012 at 3:21 PM, Richard Guenther  wrote:
>>
>> This fixes PR49484 by protecting __gcov_flush against concurrent
>> execution.  To be able to use the gthread facility I have to
>> introduce the requirement that __GTHREAD_MUTEX_INIT_FUNCTION
>> is always available, even if __GTHREAD_MUTEX_INIT is available as
>> otherwise no dynamic initialization of a mutex is possible.
>> I have adjusted gthr-posix.h and gthr-single.h only - target
>> maintainers, please update your ports accordingly in advance.
>>
>> Boostrap and regtest on x86_64-unknown-linux-gnu is ongoing,
>> but this looks like something for stage1 anyway.
>
> Bootstrap and regtest finished ok.  I am going to commit this without "fixing"
> eventually broken targets that I know nothing of.  See above.
>
> Unless I hear objections until tomorrow.

Done now, after waiting another week.

Thanks,
Richard.

>> 2012-01-18  Richard Guenther  
>>
>>        * gthr.h (__GTHREAD_MUTEX_INIT_FUNCTION): Adjust specification.
>>        * gthr-posix.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.
>>        (__gthread_mutex_init_function): New function.
>>        * gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.
>>
>>        PR gcov/49484
>>        * libgcov.c: Include gthr.h.
>>        (__gcov_flush_mx): New global variable.
>>        (init_mx, init_mx_once): New functions.
>>        (__gcov_flush): Protect self with a mutex.
>>        (__gcov_fork): Re-initialize mutex after forking.
>>        * unwind-dw2-fde.c: Change condition under which to use
>>        __GTHREAD_MUTEX_INIT_FUNCTION.


Re: Doc: Merge Alpha/VMS and IA-64/VMS options

2012-03-12 Thread Tristan Gingold

On Mar 12, 2012, at 2:07 PM, Richard Guenther wrote:

> On Mon, Mar 12, 2012 at 2:00 PM, Tristan Gingold  wrote:
>> Hi,
>> 
>> this patch merges Alpha/VMS and IA-64/VMS options as there is only one .opt 
>> for them, so there is no need to duplicate the doc.
>> 
>> It also documents -mpointer-size.
>> 
>> Tested by 'make info'
>> 
>> Ok for trunk ?
> 
> Ok.

Thanks, committed.

Tristan.



Re: [PATCH 2/3] Move MEM_REF expansion to a new function

2012-03-12 Thread Richard Guenther
On Mon, 12 Mar 2012, Martin Jambor wrote:

> Hi,
> 
> when we expand a misaligned MEM_REF on the LHS, we must not call the
> code in expand_expr_real_1 if the subsequent patch is applied, because
> the code generates code extracting the contents of the memory to a
> register, which is of course bad if the intent is to write into that
> memory.  Therefore expand_assignment should expand MEM_REFs itself,
> just as it do when it encounters naked misaligned ones.

Just a quick comment here - the expand_expr_real_1 code needs
to be guarded with exactly the same conditions as the misaligned
LHS case to be able to call expand_expr on it and generate a
naked MEM.  So if that is not working you have a bug in the RHS
side handling ;)

Richard.


Re: [PATCH, i386] RTM support

2012-03-12 Thread H.J. Lu
On Sun, Mar 11, 2012 at 1:16 AM, Kirill Yukhin  wrote:
>>
>> The patch is OK for mainline, if there are no further comments in next 24h.
>
> Thank you!
>
> According to Tobias's input, I've added few lines about RTM to
> doc/invoke.texi. If no objections - I'll commit the patch tomorrow.
>

I think it breaks GCC bootstrap.

-- 
H.J.


Re: [PATCH][ARM] Do not call covert during RTL expansion

2012-03-12 Thread Ramana Radhakrishnan
On 12 March 2012 10:22, Richard Guenther  wrote:
>
> convert is supposed to be called only from frontend code as it
> may raise errors.
>
> The call in neon_dereference_pointer is from RTL expansion
> (and not necessary).
>
> Fixed as follows, I built a cross-cc1 for checking.
>
> Ok?

Ok. From my reading of the code,  I agree this call is not necessary.

ramana


[doc] GCC 4.7 IRIX, Tru64 UNIX updates to install.texi

2012-03-12 Thread Rainer Orth
Reviewing install.texi for the 4.7 release, I found that it only needs
trivial updates for Tru64 UNIX and IRIX.

Tested with make doc/gccinstall.info doc/gccinstall.pdf.

Ok for 4.7 branch?  I won't apply the patch to mainline since I'm about
to remove both ports there.

Thanks.
Rainer


2012-03-11  Rainer Orth  

* doc/install.texi (Specific, alpha*-dec-osf5.1): Update binutils
reference.
(Specific, mips-sgi-irix6): Likewise.

# HG changeset patch
# Parent bf29b6f1cf94c37151c9da1d6014e7faf6d74984
GCC 4.7 IRIX, Tru64 UNIX updates to install.texi

diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -3175,7 +3175,7 @@ or applying the patch in
 the OS version used, you need a data segment size between 512 MB and
 1 GB, so simply use @command{ulimit -Sd unlimited}.
 
-As of GNU binutils 2.21, neither GNU @command{as} nor GNU @command{ld}
+As of GNU binutils 2.22, neither GNU @command{as} nor GNU @command{ld}
 are supported on Tru64 UNIX, so you must not configure GCC with
 @option{--with-gnu-as} or @option{--with-gnu-ld}.
 
@@ -4066,7 +4066,7 @@ Look for @file{/usr/lib64/libc.so.1} to 
 have the 64-bit libraries installed.
 
 GCC must be configured with GNU @command{as}.  The latest version, from GNU
-binutils 2.21, is known to work.  On the other hand, bootstrap fails
+binutils 2.22, is known to work.  On the other hand, bootstrap fails
 with GNU @command{ld} at least since GNU binutils 2.17.
 
 The @option{--enable-libgcj}


-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [doc] GCC 4.7 IRIX, Tru64 UNIX updates to install.texi

2012-03-12 Thread Richard Guenther
On Mon, 12 Mar 2012, Rainer Orth wrote:

> Reviewing install.texi for the 4.7 release, I found that it only needs
> trivial updates for Tru64 UNIX and IRIX.
> 
> Tested with make doc/gccinstall.info doc/gccinstall.pdf.
> 
> Ok for 4.7 branch?  I won't apply the patch to mainline since I'm about
> to remove both ports there.

Ok.

Thanks,
Richard.

> Thanks.
>   Rainer
> 
> 
> 2012-03-11  Rainer Orth  
> 
>   * doc/install.texi (Specific, alpha*-dec-osf5.1): Update binutils
>   reference.
>   (Specific, mips-sgi-irix6): Likewise.


[doc] GCC 4.7 Solaris updates to install.texi

2012-03-12 Thread Rainer Orth
The following patch updates install.texi for Solaris, and applies
equally to the 4.7 branch and mainline.

Tested with make doc/gccinstall.info doc/gccinstall.pdf, ok for mainline
and 4.7 branch?

Rainer


2012-03-11  Rainer Orth  

* doc/install.texi (Specific, i?86-*-solaris2.[89]): Update
binutils reference.
(Specific, i?86-*-solaris2.10): Remove GCC 4.0 reference.
Update binutils references.
(Specific, *-*-solaris2*): Mention bundled GCC in Solaris 10 and 11.
Update binutils reference.
Update Sun as/GNU ld caveat.
Document binutils largefile requirement for LTO plugin.
Remove referent to alternate libpthread.

# HG changeset patch
# Parent 87d293abd3111de02ec54b8b863d495e7bf7e1f8
GCC 4.7 Solaris updates to install.texi

diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -3612,7 +3612,7 @@ The Sun assembler in Solaris 8 and 9 has
 While GCC works around them, several features are missing, so it is
 @c FIXME: which ones?
 recommended to use the GNU assembler instead.  There is no bundled
-version, but the current version, from GNU binutils 2.21, is known to
+version, but the current version, from GNU binutils 2.22, is known to
 work.
 
 Solaris@tie{}2/x86 doesn't support the execution of SSE/SSE2 instructions
@@ -3628,8 +3628,7 @@ you have the patch installed, you can co
 
 @end html
 @heading @anchor{ix86-x-solaris210}i?86-*-solaris2.10
-Use this for Solaris 10 or later on x86 and x86-64 systems.  This
-configuration is supported by GCC 4.0 and later versions only.  Starting
+Use this for Solaris 10 or later on x86 and x86-64 systems.  Starting
 with GCC 4.7, there is also a 64-bit @samp{amd64-*-solaris2.1[0-9]*} or
 @samp{x86_64-*-solaris2.1[0-9]*} configuration that corresponds to
 @samp{sparcv9-sun-solaris2*}.
@@ -3638,7 +3637,7 @@ It is recommended that you configure GCC
 @file{/usr/sfw/bin/gas}.  The versions included in Solaris 10, from GNU
 binutils 2.15, and Solaris 11, from GNU binutils 2.19, work fine,
 although the current version, from GNU binutils
-2.21, is known to work, too.  Recent versions of the Sun assembler in
+2.22, is known to work, too.  Recent versions of the Sun assembler in
 @file{/usr/ccs/bin/as} work almost as well, though.
 @c FIXME: as patch requirements?
 
@@ -3646,7 +3645,7 @@ For linking, the Sun linker, is preferre
 linker instead, which is available in @file{/usr/sfw/bin/gld}, note that
 due to a packaging bug the version in Solaris 10, from GNU binutils
 2.15, cannot be used, while the version in Solaris 11, from GNU binutils
-2.19, works, as does the latest version, from GNU binutils 2.21.
+2.19, works, as does the latest version, from GNU binutils 2.22.
 
 To use GNU @command{as}, configure with the options
 @option{--with-gnu-as --with-as=@//usr/@/sfw/@/bin/@/gas}.  It may be necessary
@@ -4217,8 +4216,10 @@ Support for Solaris 8 has been obsoleted
 enabled by configuring with @option{--enable-obsolete}.  Support will be
 removed in GCC 4.8.  Support for Solaris 7 has been removed in GCC 4.6.
 
-Sun does not ship a C compiler with Solaris 2, though you can download
-the Sun Studio compilers for free.  Alternatively,
+Sun does not ship a C compiler with Solaris 2 before Solaris 10, though
+you can download the Sun Studio compilers for free.  In Solaris 10 and
+11, GCC 3.4.3 is available in @command{/usr/sfw/bin/gcc}.  Solaris 11
+also provides GCC 4.5.2 in @command{/usr/gcc/4.5/bin/gcc}.  Alternatively,
 you can install a pre-built GCC to bootstrap and install GCC.  See the
 @uref{binaries.html,,binaries page} for details.
 
@@ -4261,17 +4262,19 @@ We recommend the use of the Sun assemble
 conjunction with the Sun linker.  The GNU @command{as}
 versions included in Solaris 10, from GNU binutils 2.15, and Solaris 11,
 from GNU binutils 2.19, are known to work.  They can be found in
-@file{/usr/sfw/bin/gas}.  Current versions of GNU binutils (2.21)
+@file{/usr/sfw/bin/gas}.  Current versions of GNU binutils (2.22)
 are known to work as well.  Note that your mileage may vary
 if you use a combination of the GNU tools and the Sun tools: while the
 combination GNU @command{as} + Sun @command{ld} should reasonably work,
-the reverse combination Sun @command{as} + GNU @command{ld} is known to
-cause memory corruption at runtime in some cases for C++ programs.
+the reverse combination Sun @command{as} + GNU @command{ld} may fail to
+build or cause memory corruption at runtime in some cases for C++ programs.
 @c FIXME: still?
 GNU @command{ld} usually works as well, although the version included in
 Solaris 10 cannot be used due to several bugs.  Again, the current
-version (2.21) is known to work, but generally lacks platform specific
-features, so better stay with Sun @command{ld}.
+version (2.22) is known to work, but generally lacks platform specific
+features, so better stay with Sun @command{ld}.  To use the LTO linker
+plugin (

Re: [PATCH 2/3] Move MEM_REF expansion to a new function

2012-03-12 Thread Michael Matz
Hi,

On Mon, 12 Mar 2012, Martin Jambor wrote:

> when we expand a misaligned MEM_REF on the LHS, we must not call the
> code in expand_expr_real_1 if the subsequent patch is applied, because
> the code generates code extracting the contents of the memory to a
> register, which is of course bad if the intent is to write into that
> memory.

Then expand_expr_real_1 should be called with EXPAND_WRITE modifier, 
instead of any of the others.  Then it will (or should) return an lvalue.  
That might still be wrong for alignment reasons, but writing into the so 
returned rtx will change the original object.

> Therefore expand_assignment should expand MEM_REFs itself,
> just as it do when it encounters naked misaligned ones.

I think this goes into the wrong direction.  expand_assignment shouldn't 
create an lvalue rtx for any REFs itself.  It should call expand_expr with 
EXPAND_WRITE, and that should do the right thing (i.e. what's now done 
directly in expand_assignment).

I realize the docu of EXPAND_WRITE is lacking, but here's what I think it 
should do (and what I think it actually also mostly does already): Given 
EXPAND_WRITE expand_expr is required to be called on an (sub)object, i.e. 
an lvalue, and it should return an RTX lvalue (a REG or MEM) that if 
written into is changing the originally specified tree lvalue (i.e. not 
some temporary storage).

That doesn't mean that the result of expand_expr(EXPAND_WRITE) is directly 
usable in a simple RTL (set) pattern as LHS in all cases.  For instance it 
won't be directly usable when it's misalign.  Dealing with this situation 
is left to the caller, i.e. expand_assignment mostly.

> - When expanding the base, the two functions differ in the
>   expand_modifier they pass down to expand_expr.  expand_assignment
>   uses EXPAND_NORMAL while expand_expr_real_1 passes EXPAND_SUM.
>   According to the comment in expr.h the latter seemed more permissive
>   and so I used that, even though I admit I do not really know what
>   the implications of this modifier are.  Is it OK to use EXPAND_SUM
>   also on a LHS?

No, but it might not matter in the situations you are facing, haven't 
checked.  EXPAND_SUM can return a PLUS rtx, e.g.
  (plus (p60) (const_int 4))
for an offsetted address.  Naturally you can't assign into such a plus 
rtx.  But if you only expand the base with that modifier (which for 
BLKmode bases actually means expanding to a MEM containing the address of 
base) you should be fine with EXPAND_SUM, it won't be used I think.


Ciao,
Michael.


Re: [doc] GCC 4.7 Solaris updates to install.texi

2012-03-12 Thread Richard Guenther
On Mon, 12 Mar 2012, Rainer Orth wrote:

> The following patch updates install.texi for Solaris, and applies
> equally to the 4.7 branch and mainline.
> 
> Tested with make doc/gccinstall.info doc/gccinstall.pdf, ok for mainline
> and 4.7 branch?

Ok.

Thanks,
Richard.

>   Rainer
> 
> 
> 2012-03-11  Rainer Orth  
> 
>   * doc/install.texi (Specific, i?86-*-solaris2.[89]): Update
>   binutils reference.
>   (Specific, i?86-*-solaris2.10): Remove GCC 4.0 reference.
>   Update binutils references.
>   (Specific, *-*-solaris2*): Mention bundled GCC in Solaris 10 and 11.
>   Update binutils reference.
>   Update Sun as/GNU ld caveat.
>   Document binutils largefile requirement for LTO plugin.
>   Remove referent to alternate libpthread.
> 
> 

-- 
Richard Guenther 
SUSE / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer

Re: [PATCH][1/n] No longer sign-extend sizetype constants, remove TYPE_IS_SIZETYPE

2012-03-12 Thread Richard Guenther
On Fri, 9 Mar 2012, Eric Botcazou wrote:

> > Well.  I suppose fixing that negative DECL_FIELD_OFFSET thing should
> > be #1 priority.
> 
> Tentative patch attached (you need an up-to-date tree).  We cannot really get 
> rid of the negative offsets for thin pointers, so the patch pulls them out of 
> record types and uses pointer arithmetics instead.

Thanks.  That seems to get me into Ada bootstrap land together with
the following two patches applied (but not when I apply only the
first patch due to the stale TREE_OVERFLOW bits on type/decl sizes).

Richard.

2012-03-06  Richard Guenther  

* tree.c (valid_constant_size_p): New function.
* tree.h (valid_constant_size_p): Declare.
* cfgexpand.c (expand_one_var): Adjust check for too large
variables by using valid_constant_size_p.
* varasm.c (assemble_variable): Likewise.

c/
* c-decl.c (grokdeclarator): Properly check for sizes that
cover more than half of the address-space.

cp/
* decl.c (grokdeclarator): Properly check for sizes that
cover more than half of the address-space.

Index: trunk/gcc/tree.c
===
*** trunk.orig/gcc/tree.c   2012-03-06 13:54:25.0 +0100
--- trunk/gcc/tree.c2012-03-06 14:46:08.0 +0100
*** compare_tree_int (const_tree t, unsigned
*** 6829,6834 
--- 6829,6848 
  return 1;
  }
  
+ /* Return true if SIZE represents a constant size that is in bounds of
+what the middle-end and the backend accepts (covering not more than
+half of the address-space).  */
+ 
+ bool
+ valid_constant_size_p (const_tree size)
+ {
+   if (! host_integerp (size, 1)
+   || TREE_OVERFLOW (size)
+   || tree_int_cst_sign_bit (size) != 0)
+ return false;
+   return true;
+ }
+ 
  /* Return true if CODE represents an associative tree code.  Otherwise
 return false.  */
  bool
Index: trunk/gcc/varasm.c
===
*** trunk.orig/gcc/varasm.c 2012-03-06 13:54:25.0 +0100
--- trunk/gcc/varasm.c  2012-03-06 14:46:08.0 +0100
*** assemble_variable (tree decl, int top_le
*** 1987,1993 
  return;
  
if (! dont_output_data
!   && ! host_integerp (DECL_SIZE_UNIT (decl), 1))
  {
error ("size of variable %q+D is too large", decl);
return;
--- 1987,1993 
  return;
  
if (! dont_output_data
!   && ! valid_constant_size_p (DECL_SIZE_UNIT (decl)))
  {
error ("size of variable %q+D is too large", decl);
return;
Index: trunk/gcc/c-decl.c
===
*** trunk.orig/gcc/c-decl.c 2012-03-06 13:54:25.0 +0100
--- trunk/gcc/c-decl.c  2012-03-06 14:46:08.0 +0100
*** grokdeclarator (const struct c_declarato
*** 5798,5809 
}
  }
  
!   /* Did array size calculations overflow?  */
! 
if (TREE_CODE (type) == ARRAY_TYPE
&& COMPLETE_TYPE_P (type)
&& TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST
!   && TREE_OVERFLOW (TYPE_SIZE_UNIT (type)))
  {
if (name)
error_at (loc, "size of array %qE is too large", name);
--- 5798,5809 
}
  }
  
!   /* Did array size calculations overflow or does the array cover more
!  than half of the address-space?  */
if (TREE_CODE (type) == ARRAY_TYPE
&& COMPLETE_TYPE_P (type)
&& TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST
!   && ! valid_constant_size_p (TYPE_SIZE_UNIT (type)))
  {
if (name)
error_at (loc, "size of array %qE is too large", name);
Index: trunk/gcc/cp/decl.c
===
*** trunk.orig/gcc/cp/decl.c2012-03-06 13:54:25.0 +0100
--- trunk/gcc/cp/decl.c 2012-03-06 14:46:08.0 +0100
*** grokdeclarator (const cp_declarator *dec
*** 9635,9646 
  error ("non-parameter %qs cannot be a parameter pack", name);
  }
  
!   /* Did array size calculations overflow?  */
! 
if (TREE_CODE (type) == ARRAY_TYPE
&& COMPLETE_TYPE_P (type)
&& TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST
!   && TREE_OVERFLOW (TYPE_SIZE_UNIT (type)))
  {
error ("size of array %qs is too large", name);
/* If we proceed with the array type as it is, we'll eventually
--- 9635,9646 
  error ("non-parameter %qs cannot be a parameter pack", name);
  }
  
!   /* Did array size calculations overflow or does the array cover more
!  than half of the address-space?  */
if (TREE_CODE (type) == ARRAY_TYPE
&& COMPLETE_TYPE_P (type)
&& TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST
!   && ! valid_constant_size_p (TYPE_SIZE_UNIT (type)))
  {
error ("size of array %qs is too large", name);
/* If we proceed with t

[VMS/committed]: Fix ABI issue on vms/ia64

2012-03-12 Thread Tristan Gingold
Hi,

ia64/VMS doesn't closely follow the 'standard' ia64 ABI (in order to be 
backward compatible with VAX).
We recently found one mismatch while passing FP parameters.

Manually tested and checked - no test case added as this require another 
compiler to test.

Committed on trunk.

Tristan.

2012-03-12  Tristan Gingold  

* config/ia64/ia64.c (ia64_function_arg_1): Move code around.
(ia64_function_arg_advance): Ditto.

Index: gcc/config/ia64/ia64.c
===
--- gcc/config/ia64/ia64.c  (revision 185231)
+++ gcc/config/ia64/ia64.c  (working copy)
@@ -4491,6 +4491,15 @@
   if (cum->words + offset >= MAX_ARGUMENT_SLOTS)
 return 0;
 
+  /* On OpenVMS argument is either in Rn or Fn.  */
+  if (TARGET_ABI_OPEN_VMS)
+{
+  if (FLOAT_MODE_P (mode))
+   return gen_rtx_REG (mode, FR_ARG_FIRST + cum->words);
+  else
+   return gen_rtx_REG (mode, basereg + cum->words);
+}
+
   /* Check for and handle homogeneous FP aggregates.  */
   if (type)
 hfa_mode = hfa_element_mode (type, 0);
@@ -4577,15 +4586,6 @@
   return gen_rtx_PARALLEL (mode, gen_rtvec_v (i, loc));
 }
   
-  /* On OpenVMS variable argument is either in Rn or Fn.  */
-  else if (TARGET_ABI_OPEN_VMS && named == 0)
-{
-  if (FLOAT_MODE_P (mode))
-   return gen_rtx_REG (mode, FR_ARG_FIRST + cum->words);
-  else
-   return gen_rtx_REG (mode, basereg + cum->words);
-}
-
   /* Integral and aggregates go in general registers.  If we have run out of
  FR registers, then FP values must also go in general registers.  This can
  happen when we have a SFmode HFA.  */
@@ -4736,6 +4736,14 @@
   cum->atypes[cum->words] = ia64_arg_type (mode);
   cum->words += words + offset;
 
+  /* On OpenVMS argument is either in Rn or Fn.  */
+  if (TARGET_ABI_OPEN_VMS && named == 0)
+{
+  cum->int_regs = cum->words;
+  cum->fp_regs = cum->words;
+  return;
+}
+
   /* Check for and handle homogeneous FP aggregates.  */
   if (type)
 hfa_mode = hfa_element_mode (type, 0);
@@ -4776,13 +4784,6 @@
   cum->fp_regs = fp_regs;
 }
 
-  /* On OpenVMS variable argument is either in Rn or Fn.  */
-  else if (TARGET_ABI_OPEN_VMS && named == 0)
-{
-  cum->int_regs = cum->words;
-  cum->fp_regs = cum->words;
-}
-
   /* Integral and aggregates go in general registers.  So do TFmode FP values.
  If we have run out of FR registers, then other FP values must also go in
  general registers.  This can happen when we have a SFmode HFA.  */


Re: Remove obsolete OpenBSD/MIPS support

2012-03-12 Thread Rainer Orth
Richard Sandiford  writes:

> Rainer Orth  writes:
>> I'm currently working on removing the obsolete Tru64 UNIX and IRIX
>> ports.  When IRIX is gone, the obsoleted OpenBSD/MIPS is the only
>> remaining port that uses MIPS_DEBUGGING_INFO (which I plan to remove as
>> a followup once IRIX is gone).
>>
>> The following patch has been included in a i386-pc-solaris2.10 bootstrap
>> to make sure that no obvious syntactic errors have crept in.
>>
>> Ok for mainline?
>
> Definitely.  Thanks for saving me the legwork :-)
>
> There are also some SDB_OUTPUT_SOURCE_LINE references in mips.c and
> mips.h that could go.  Removing those is preapproved if you want to
> do it as part of the same patch, otherwise I can do it this weekend.

Here's what I've installed.  The patch was bootstrapped (together with a
bunch of other removal patches to be submitted shortly) on
i386-pc-solaris2.11 and tested on an i386-solaris2.11 x mips-elf C-only
cross to make sure cc1 still builds.

Rainer


2012-02-24  Rainer Orth  

libgcc:
* config.host (mips*-*-openbsd*): Remove.

gcc:
* config.gcc (mips*-*-openbsd*): Remove.
* config/mips/openbsd.h: Remove.
* config/mips/sdb.h: Remove.

* config/mips/mips.h (SDB_OUTPUT_SOURCE_LINE): Remove.
* config/mips/mips.c (sdb_label_count): Remove.
(mips_debugger_offset): Remove #if 0 code.
(mips_output_function_prologue) [SDB_DEBUGGING_INFO]: Remove.
* config/mips/sde.h (SDB_DEBUGGING_INFO): Don't undef.

contrib:
* config-list.mk (LIST): Remove mips-openbsd.

# HG changeset patch
# Parent 629d4a30bc2bbb27d12aa73bd6e0221cecf83144
Remove obsolete OpenBSD/MIPS support

diff --git a/contrib/config-list.mk b/contrib/config-list.mk
--- a/contrib/config-list.mk
+++ b/contrib/config-list.mk
@@ -39,7 +39,7 @@ LIST = alpha-linux-gnu alpha-freebsd6 al
   mips-sgi-irix6.5OPT-with-stabsOPT-enable-threads=posixOPT-enable-obsolete \
   mips-netbsd \
   mips64el-st-linux-gnu mips64octeon-linux mipsisa64r2-linux \
-  mipsisa32r2-linux-gnu mips-openbsd mipsisa64r2-sde-elf mipsisa32-elfoabi \
+  mipsisa32r2-linux-gnu mipsisa64r2-sde-elf mipsisa32-elfoabi \
   mipsisa64-elfoabi mipsisa64r2el-elf mipsisa64sr71k-elf mipsisa64sb1-elf \
   mipsel-elf mips64-elf mips64vr-elf mips64orion-elf mips-rtems \
   mips-wrs-vxworks mipstx39-elf mmix-knuth-mmixware mn10300-elf moxie-elf \
diff --git a/gcc/config.gcc b/gcc/config.gcc
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -251,7 +251,6 @@ case ${target} in
  | arm*-*-uclinux*			\
  | arm*-wince-pe*			\
  | mips-sgi-irix6.5			\
- | mips*-*-openbsd*			\
  | score-*\
  | *-*-solaris2.8*			\
  )
@@ -1744,17 +1743,6 @@ mips*-*-linux*)# Linux MIPS, either 
 esac
 	test x$with_llsc != x || with_llsc=yes
 	;;
-mips*-*-openbsd*)
-	tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_OBJECT OBSD_HAS_CORRECT_SPECS"
-	target_cpu_default="MASK_ABICALLS"
-	tm_file="mips/mips.h openbsd.h openbsd-stdint.h openbsd-libpthread.h mips/openbsd.h mips/sdb.h"
-	extra_options="${extra_options} openbsd.opt"
-	case ${target} in
-	mips*el-*-openbsd*)
-	tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=0";;
-	*)  tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=MASK_BIG_ENDIAN";;
-esac
-	;;
 mips*-sde-elf*)
 	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/sde.h"
 	tmake_file="mips/t-sde"
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -494,9 +494,6 @@ int num_source_filenames;
written anything yet.  */
 const char *current_function_file = "";
 
-/* A label counter used by PUT_SDB_BLOCK_START and PUT_SDB_BLOCK_END.  */
-int sdb_label_count;
-
 /* Arrays that map GCC register numbers to debugger register numbers.  */
 int mips_dbx_regno[FIRST_PSEUDO_REGISTER];
 int mips_dwarf_regno[FIRST_PSEUDO_REGISTER];
@@ -8114,13 +8111,6 @@ mips_debugger_offset (rtx addr, HOST_WID
 	offset += cfun->machine->frame.hard_frame_pointer_offset;
 }
 
-  /* sdbout_parms does not want this to crash for unrecognized cases.  */
-#if 0
-  else if (reg != arg_pointer_rtx)
-fatal_insn ("mips_debugger_offset called with non stack/frame/arg pointer",
-		addr);
-#endif
-
   return offset;
 }
 
@@ -10129,11 +10119,6 @@ mips_output_function_prologue (FILE *fil
 {
   const char *fnname;
 
-#ifdef SDB_DEBUGGING_INFO
-  if (debug_info_level != DINFO_LEVEL_TERSE && write_symbols == SDB_DEBUG)
-SDB_OUTPUT_SOURCE_LINE (file, DECL_SOURCE_LINE (current_function_decl));
-#endif
-
   /* In MIPS16 mode, we may need to generate a non-MIPS16 stub to handle
  floating-point arguments.  */
   if (TARGET_MIPS16
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -2551,10 +2551,6 @@ do	\
   }	\
 while (0)
 
-/* Use .loc directives for SDB line numbers.  */
-#define SDB_OUTPUT_SOURCE_LINE(STREAM, LINE)			\
-  f

Re: PATCH: Properly set ix86_gen_leave and ix86_gen_monitor

2012-03-12 Thread H.J. Lu
On Mon, Mar 12, 2012 at 12:40 AM, Uros Bizjak  wrote:
> On Mon, Mar 12, 2012 at 12:02 AM, H.J. Lu  wrote:
>
>> leave_rex64 works on DImode and sse3_monitor64 works on Pmode.  This
>> patch properly sets ix86_gen_leave and ix86_gen_monitor, depending on
>> TARGET_64BIT and Pmode.  Tested on Linux/x86-64.  OK for trunk?
>>
>> 2012-03-11  H.J. Lu  
>>
>>        * config/i386/i386.c (ix86_option_override_internal): Properly
>>        set ix86_gen_leave and ix86_gen_monitor.  Check Pmode == DImode.
>>
>>        * config/i386/sse.md (sse3_monitor64): Renamed to ...
>>        (sse3_monitor64_): This.
>
> Please provide more descriptive ChangeLog. You are changing the check
> on quite some global variables, please state them explicitly.

Here is the ChangeLog entry I checked in.

> Otherwise the patch is OK.
>
> BTW: I sincerely hope you reviewed all the places where these globals
> are used...
>
> Uros.

I verified that those ix86_gen_xxx function pointers I changed to
check Pmode == DImode are used to work on Pmode, like
stack or pointers.

Thanks.

-- 
H.J.
---
2012-03-12  H.J. Lu  

* config/i386/i386.c (ix86_option_override_internal): Properly
set ix86_gen_leave and ix86_gen_monitor.  Check Pmode == DImode,
instead of TARGET_64BIT, to set ix86_gen_add3, ix86_gen_sub3,
ix86_gen_one_cmpl2, ix86_gen_andsp,
ix86_gen_allocate_stack_worker, ix86_gen_adjust_stack_and_probe
and ix86_gen_probe_stack_range.

* config/i386/sse.md (sse3_monitor64): Renamed to ...
(sse3_monitor64_): This.


[build] Remove extra_passes

2012-03-12 Thread Rainer Orth
As suggested, this patch removes the now unused extra_passes mechanism.

Bootstrapped with no regressions on i386-pc-solaris2.11, ok for
mainline?

Rainer


2012-03-09  Rainer Orth  

* config.gcc (extra_passes): Remove.
* configure.ac (extra_passes): Don't substitute.
* configure: Regenerate.
* Makefile.in (EXTRA_PASSES): Remove.
(GCC_PASSES): Remove $(EXTRA_PASSES).
(MOSTLYCLEANFILES): Likewise.
(native): Likewise.
(install-common): Likewise.

# HG changeset patch
# Parent 72aa91c9cd9c14a295c4c4f7c8e60b83e9ce7f2f
Remove extra_passes

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -670,11 +670,8 @@ INHIBIT_LIBC_CFLAGS = -Dinhibit_libc
 endif
 
 # List of extra executables that should be compiled for this target machine
-# that are used for compiling from source code to object code.
+# that are used when linking.
 # The rules for compiling them should be in the t-* file for the machine.
-EXTRA_PASSES =@extra_passes@
-
-# Like EXTRA_PASSES, but these are used when linking.
 EXTRA_PROGRAMS = @extra_programs@
 
 # List of extra object files that should be compiled and linked with
@@ -724,7 +721,7 @@ COMPILERS = cc1$(exeext) @all_compilers@
 
 # List of things which should already be built whenever we try to use xgcc
 # to compile anything (without linking).
-GCC_PASSES=xgcc$(exeext) cc1$(exeext) specs $(EXTRA_PASSES)
+GCC_PASSES=xgcc$(exeext) cc1$(exeext) specs
 
 # Directory to link to, when using the target `maketest'.
 DIR = ../gcc
@@ -1481,7 +1478,7 @@ MOSTLYCLEANFILES = insn-flags.h insn-con
  tm-preds.h tm-constrs.h checksum-options \
  tree-check.h min-insn-modes.c insn-modes.c insn-modes.h \
  genrtl.h gt-*.h gtype-*.h gtype-desc.c gtyp-input.list \
- xgcc$(exeext) cpp$(exeext) cc1$(exeext) $(EXTRA_PASSES) \
+ xgcc$(exeext) cpp$(exeext) cc1$(exeext) \
  $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
  $(SPECS) collect2$(exeext) gcc-ar$(exeext) gcc-nm$(exeext) \
  gcc-ranlib$(exeext) \
@@ -1717,7 +1714,7 @@ rest.encap: lang.rest.encap
 # This is what is made with the host's compiler
 # whether making a cross compiler or not.
 native: config.status auto-host.h build-@POSUB@ $(LANGUAGES) \
-	$(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(COLLECT2) lto-wrapper$(exeext) \
+	$(EXTRA_PROGRAMS) $(COLLECT2) lto-wrapper$(exeext) \
 	gcc-ar$(exeext) gcc-nm$(exeext) gcc-ranlib$(exeext)
 
 ifeq ($(enable_plugin),yes)
@@ -4561,7 +4558,7 @@ install-common: native lang.install-comm
 	  else true; \
 	  fi; \
 	done
-	for file in $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(COLLECT2) ..; do \
+	for file in $(EXTRA_PROGRAMS) $(COLLECT2) ..; do \
 	  if [ x"$$file" != x.. ]; then \
 	rm -f $(DESTDIR)$(libexecsubdir)/$$file; \
 	$(INSTALL_PROGRAM) $$file $(DESTDIR)$(libexecsubdir)/$$file; \
diff --git a/gcc/config.gcc b/gcc/config.gcc
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -129,10 +129,8 @@
 #			such a system header; otherwise "none", do not
 #			provide such a header at all.
 #
-#  extra_passes		List of extra executables compiled for this target
-#			machine, used for compiling from source to object.
-#
-#  extra_programs	Like extra_passes, but these are used when linking.
+#  extra_programs	List of extra executables compiled for this target
+#			machine, used when linking.
 #
 #  extra_options	List of target-dependent .opt files.
 #
@@ -205,7 +203,6 @@ user_headers_inc_next_pre=
 user_headers_inc_next_post=
 use_gcc_tgmath=yes
 use_gcc_stdint=none
-extra_passes=
 extra_programs=
 extra_objs=
 extra_gcc_objs=
diff --git a/gcc/configure.ac b/gcc/configure.ac
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -4974,7 +4974,6 @@ AC_SUBST(user_headers_inc_next_pre)
 AC_SUBST(user_headers_inc_next_post)
 AC_SUBST(extra_headers_list)
 AC_SUBST(extra_objs)
-AC_SUBST(extra_passes)
 AC_SUBST(extra_programs)
 AC_SUBST(float_h_file)
 AC_SUBST(gcc_config_arguments)


-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: Remove obsolete Tru64 UNIX V5.1B support

2012-03-12 Thread Paolo Carlini
On 03/12/2012 05:06 PM, Rainer Orth wrote:
> I think the remaining changes are either obvious or covered by osf or
> testsuite maintainerships, so I've applied the patch. Thanks. Rainer
Thanks, but please remove all the spurious 'libstdc++v3' from the
ChangeLog entry and make sure it's wrapped to 80 columns.

Thanks,
Paolo.


Re: [C++ Patch] for c++/52465

2012-03-12 Thread Fabien Chêne
Salut Dodji,

2012/3/12 Dodji Seketeli :
[...]
>> Index: gcc/cp/decl.c
>> ===
>> --- gcc/cp/decl.c     (revision 184891)
>> +++ gcc/cp/decl.c     (working copy)
>> @@ -8686,6 +8686,9 @@ grokdeclarator (const cp_declarator *dec
>>        type = NULL_TREE;
>>        type_was_error_mark_node = true;
>>      }
>> +
>> +  type = strip_using_decl (type);
>> +
>
> I am a little bit curious as to why this change is necessary.  It seems
> to me that the test case of your patch would pass even without this
> change, wouldn't it?

Yes, this testcase would pass, but an existing testcase wouldn't. I
don't remeber which one, but I think it was related to using
declarations that refer to a typedef.

struct A { typedef int T; };
stuct B : A { using B::T; };

-- 
Fabien


Remove non-GAS non-ELF support in alpha backend

2012-03-12 Thread Rainer Orth
While having the osf removal patch reviewed, it turned out that with the
last non-gas non-ELF alpha port gone, there's considerable cleanup
potential in the alpha backend.  The following patch implements this:

* HAVE_STAMP_H was only defined by osf5.h, not configure, so the code is
  stale.

* All remaining alpha targets use gas, so TARGET_GAS and MASK_GAS can
  go.  I keep -mgas as a no-op, but completely remove -malpha-as which
  can only ever have been used on osf.

* Likewise, all references to ECOFF can be removed, every port that
  remains is ELF.

* AFAICS, the remaining ports use DWARF exclusively, so {SDB, DBX,
  MIPS}_DEBUGGING_INFO references can be removed.

There are only two issues:

* In alpha.c (alpha_option_override), it's unclear if the optimize > 0
  test can be removed completely.

* During testing, I ran into this error:

  alpha.md:5861: `*builtin_setjmp_receiver_er_1' matches 
`*builtin_setjmp_receiver_er_sl_1'
  alpha.md:5856: previous definition of `*builtin_setjmp_receiver_er_sl_1'

  The condition was the same before I remove the &&
  TARGET_AS_CAN_SUBTRACT_LABELS, actually, but to allow the patch to
  build, I'm adding && 1 for the moment.  No idea what's the proper fix.

Tested with i386-solaris2.11 x alpha-freebsd6.0 and i386-solaris2.11 x
alpha-vms C-only crosses.

Ok for mainline?

Rainer


2012-03-09  Rainer Orth  

gcc:
* config/alpha/alpha.c [HAVE_STAMP_H]: Remove.
(alpha_file_start) [MS_STAMP]: Remove.

* config/alpha/elf.h (TARGET_GAS): Remove.
* config/alpha/freebsd.h (TARGET_DEFAULT): Remove.
* config/alpha/linux.h (TARGET_DEFAULT): Remove.
* config/alpha/netbsd.h (TARGET_DEFAULT): Remove.
* config/alpha/vms.h (TARGET_DEFAULT): Remove MASK_GAS.
* config.gcc (alpha*-*-linux*): Remove target_cpu_default.
(alpha*-*-freebsd*): Likewise.
(alpha*-*-netbsd*): Likewise.
(alpha*-*-openbsd*): Likewise.
(alpha*-*-*): Remove target_cpu_default2.
* config/alpha/alpha.c (alpha_output_filename): Remove !TARGET_GAS
handling.
* config/alpha/alpha.h (TARGET_AS_CAN_SUBTRACT_LABELS): Remove.
(TARGET_AS_SLASH_BEFORE_SUFFIX): Remove.
* config/alpha/alpha.c (print_operand): Always assume
TARGET_AS_SLASH_BEFORE_SUFFIX.
* config/alpha/alpha.md ("*builtin_setjmp_receiver_er_sl_1"):
Remove TARGET_AS_CAN_SUBTRACT_LABELS.
* config/alpha/alpha.opt (malpha-as): Remove.
(mgas): Ignore.
* doc/invoke.texi (Option Summary, DEC Alpha Options): Remove
-malpha-as, -mgas.
Remove DEC Unix reference.

* config/alpha/alpha.h (OBJECT_FORMAT_COFF): Remove.
(EXTENDED_COFF): Remove.
* config/alpha/elf.h (OBJECT_FORMAT_COFF): Don't undef.
(EXTENDED_COFF): Don't undef.
* config/alpha/alpha.c (alpha_file_start): Always assume
OBJECT_FORMAT_ELF.
[!OBJECT_FORMAT_ELF]: Remove.

* config/alpha/alpha.h (SDB_DEBUGGING_INFO): Remove.
(DBX_DEBUGGING_INFO): Remove.
(MIPS_DEBUGGING_INFO): Remove.
(PREFERRED_DEBUGGING_TYPE): Remove.
(DBX_OUTPUT_SOURCE_LINE): Remove.
(SDB_OUTPUT_SOURCE_LINE): Remove.
(DBX_CONTIN_LENGTH): Remove.
(NO_DBX_FUNCTION_END): Remove.
(ASM_STABS_OP): Remove.
(ASM_STABN_OP): Remove.
(ASM_STABD_OP): Remove.
(SDB_ALLOW_FORWARD_REFERENCES): Remove.
(SDB_ALLOW_UNKNOWN_REFERENCES): Remove.
(PUT_SDB_DEF): Remove.
(PUT_SDB_PLAIN_DEF): Remove.
(PUT_SDB_TYPE): Remove.
(sdb_label_count): Remove.
(PUT_SDB_BLOCK_START): Remove.
(PUT_SDB_BLOCK_END): Remove.
(PUT_SDB_FUNCTION_START): Remove.
(PUT_SDB_FUNCTION_END): Remove.
(PUT_SDB_EPILOGUE_END): Remove.
* config/alpha/elf.h (SDB_DEBUGGING_INFO): Don't undef.
(MIPS_DEBUGGING_INFO): Don't undef.
(DBX_DEBUGGING_INFO): Don't undef.
* config/alpha/vms.h (SDB_DEBUGGING_INFO): Don't undef.
(MIPS_DEBUGGING_INFO): Don't undef.
(DBX_DEBUGGING_INFO): Don't undef.
* config/alpha/freebsd.h (DBX_CONTIN_CHAR): Remove.
* config/alpha/alpha.c (alpha_option_override): Remove SDB_DEBUG
handling.
(alpha_start_function): Likewise.
(sdb_label_count): Remove.
(alpha_output_filename): Remove DBX_DEBUG handling.
(alpha_file_start): Likewise.

# HG changeset patch
# Parent d29db3ec27f94b839c51faadd5c8c42c56066a09
Remove non-GAS non-ELF support in alpha backend

diff --git a/gcc/config.gcc b/gcc/config.gcc
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -761,25 +761,21 @@ case ${target} in
 alpha*-*-linux*)
 	tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h glibc-stdint.h"
 	extra_options="${extra_options} alpha/elf.opt"
-	target_cpu_default="MASK_GAS"
 	;;
 alpha*-*-freebsd*)
 	tm_file="${tm_file} ${fbsd_tm_file} alpha/elf.h alpha/freebsd

Re: Remove obsolete Tru64 UNIX V5.1B support

2012-03-12 Thread Rainer Orth
Paolo Carlini  writes:

> On 03/12/2012 05:06 PM, Rainer Orth wrote:
>> I think the remaining changes are either obvious or covered by osf or
>> testsuite maintainerships, so I've applied the patch. Thanks. Rainer
> Thanks, but please remove all the spurious 'libstdc++v3' from the
> ChangeLog entry and make sure it's wrapped to 80 columns.

Oops, sorry, will do ASAP.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: Remove non-GAS non-ELF support in alpha backend

2012-03-12 Thread Richard Henderson
On 03/12/12 09:22, Rainer Orth wrote:
> There are only two issues:
> 
> * In alpha.c (alpha_option_override), it's unclear if the optimize > 0
>   test can be removed completely.

Yeah, I guess leave that for now.

> * During testing, I ran into this error:
> 
>   alpha.md:5861: `*builtin_setjmp_receiver_er_1' matches 
> `*builtin_setjmp_receiver_er_sl_1'
>   alpha.md:5856: previous definition of `*builtin_setjmp_receiver_er_sl_1'

Delete builtin_setjmp_receiver_er_1, which ought to have had && 
!TARGET_AS_CAN_SUBTRACT_LABELS,
but since patterns are matched in order, was implied by the filtering of the 
previous pattern.


r~


Re: Remove obsolete Tru64 UNIX V5.1B support

2012-03-12 Thread Rainer Orth
David Daney  writes:

> On 03/06/2012 05:14 AM, Rainer Orth wrote:
>> "Joseph S. Myers"  writes:
>>
There's one particular issue: the change to java/io/File.java required
my to regenerate the .class file in classpath.  I've used Sun javac
-target 1.5 for that and hope I got it right.
>>>
>>> I'd have expected regeneration to use GCJ built to use ECJ, though I don't
>>> know.
>>
>> I've never tried this.  Given that the .class file lives below
>> libjava/classpath and has to be synced with upstream Classpath anyway, I
>> hope the Java maintainers will take care of that.
>>
>
> This it documented (although perhaps badly) in install/configure.html
>
> You should use --enable-java-maintainer-mode, this will cause the build to
> use ecj and gjavah to regenerate all the generated files in the 'standard'
> manner.

I tried that route, but failed: even with ecj1 and gjavah scripts in
PATH, I get

/var/gcc/gcc-4.8.0-20120309/11-gcc/./gcc/gcj 
-B/var/gcc/gcc-4.8.0-20120309/11-gcc/i386-pc-solaris2.11/amd64/libjava/ 
-B/var/gcc/gcc-4.8.0-20120309/11-gcc/i386-pc-solaris2.11/amd64/libjava/ 
-B/var/gcc/gcc-4.8.0-20120309/11-gcc/./gcc/ 
-B/usr/local/i386-pc-solaris2.11/bin/ -B/usr/local/i386-pc-solaris2.11/lib/ 
-isystem /usr/local/i386-pc-solaris2.11/include -isystem 
/usr/local/i386-pc-solaris2.11/sys-include  -m64 -C -g  -fsource=1.5 
-ftarget=1.5 --bootclasspath='' 
--classpath=/vol/gcc/src/hg/trunk/solaris/libjava:/var/gcc/gcc-4.8.0-20120309/11-gcc/i386-pc-solaris2.11/amd64/libjava:/vol/gcc/src/hg/trunk/solaris/libjava/classpath:/vol/gcc/src/hg/trunk/solaris/libjava/classpath/external/w3c_dom:/vol/gcc/src/hg/trunk/solaris/libjava/classpath/external/sax:/vol/gcc/src/hg/trunk/solaris/libjava/classpath/external/relaxngDatatype:/vol/gcc/src/hg/trunk/solaris/libjava/classpath/external/jsr166:.::
 -d /vol/gcc/src/hg/trunk/solaris/libjava/classpath/lib @classes
no classpath specified
make[6]: *** [compile-classes] Error 1

I gave up and checked in the File.class file produced with Sun javac.

Rainer

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [PR51752] publication safety violations in loop invariant motion pass

2012-03-12 Thread Aldy Hernandez

On 03/10/12 08:14, Torvald Riegel wrote:

On Fri, 2012-03-09 at 15:48 -0600, Aldy Hernandez wrote:

Torvald is this what you were thinking of?


Yes, but with an exit in the else branch or something that can cause x
not being read after the condition.  I _suppose_ that your original
example would be an allowed transformation but just because x would be
read anyway independently of flag's value; we can assume data-race
freedom, and thus we must be able to read x in a data-race-free way even
if flag is false, so flag's value actually doesn't matter.

What about modifying the example like below?  In this case, if flag2 is
true, flag's value will matter and we can't move the load to x before
it.  Will PRE still introduce "tmp = x + 4" in such an example?

Torvald


+  __transaction_atomic {
+if (flag)
+  y = x + 4;
+else
+  // stuff

  if (flag2)
return;

+z = x + 4;
+  }


Hmmm, by adding the exit, PRE introduces the read of "x + 4" correctly 
*after* the read of flag2, so something like this:


__transaction_atomic {
if (flag) {
tmp = x + 4;
y = tmp;
} else {
if (flag2)
return;
tmp = x + 4;
}
z = tmp;

So... by your logic, this is allowed because the read of "x" would 
happen anyway (it is not inserted in the "flag2 != 0" case).


I'm back to having no testcase, so perhaps I should drop this patch 
until we can come up with a PRE testcase that actually triggers a 
publication safety violation.


Richi, you mentioned partial PRE inserting code into code paths that 
previously did not have reads.  Do you have an example?  As much as I 
tried, I could not trigger a partial PRE, but that may be because I 
don't understand the algorithm very well.


Thanks guys.
Aldy


Re: PATCH: Call gen_tls_global_dynamic_64_ and en_tls_local_dynamic_base_64_

2012-03-12 Thread H.J. Lu
On Mon, Mar 12, 2012 at 12:46 AM, Uros Bizjak  wrote:
> On Mon, Mar 12, 2012 at 12:26 AM, H.J. Lu  wrote:
>
>> Pmode may be DImode for x32.  This patch calls
>> gen_tls_global_dynamic_64_ and gen_tls_local_dynamic_base_64_,
>> depending on Pmode.  Tested on Linux/x86-64.  OK for trunk?
>>
>> 2012-03-11  H.J. Lu  
>>
>>        * config/i386/i386.c (legitimize_tls_address): Call
>>        gen_tls_global_dynamic_64_ and
>>        gen_tls_local_dynamic_base_64_, depending on Pmode.
>>
>>        * config/i386/i386.md (*tls_global_dynamic_64): Renamed to ...
>>        (*tls_global_dynamic_64_): This.
>>        (tls_global_dynamic_64): Renamed to ...
>>        (tls_global_dynamic_64_): This.
>>        (*tls_local_dynamic_base_64): Renamed to ...
>>        (*tls_local_dynamic_base_64): This.
>>        (tls_local_dynamic_base_64): Renamed to ...
>>        (tls_local_dynamic_base_64): This.
>>
>> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
>> index d673101..fc8fa12 100644
>> --- a/gcc/config/i386/i386.c
>> +++ b/gcc/config/i386/i386.c
>> @@ -12533,7 +12543,12 @@ legitimize_tls_address (rtx x, enum tls_model 
>> model, bool for_mov)
>>              rtx rax = gen_rtx_REG (Pmode, AX_REG), insns;
>>
>>              start_sequence ();
>> -             emit_call_insn (gen_tls_global_dynamic_64 (rax, x, caddr));
>> +             if (Pmode == DImode)
>> +               emit_call_insn (gen_tls_global_dynamic_64_di (rax, x,
>> +                                                             caddr));
>> +             else
>> +               emit_call_insn (gen_tls_global_dynamic_64_si (rax, x,
>> +                                                             caddr));
>>              insns = get_insns ();
>>              end_sequence ();
>>
>> @@ -12581,7 +12596,12 @@ legitimize_tls_address (rtx x, enum tls_model 
>> model, bool for_mov)
>>              rtx rax = gen_rtx_REG (Pmode, AX_REG), insns, eqv;
>>
>>              start_sequence ();
>> -             emit_call_insn (gen_tls_local_dynamic_base_64 (rax, caddr));
>> +             if (Pmode == DImode)
>> +               emit_call_insn (gen_tls_local_dynamic_base_64_di (rax,
>> +                                                                 caddr));
>> +             else
>> +               emit_call_insn (gen_tls_local_dynamic_base_64_si (rax,
>> +                                                                 caddr));
>>              insns = get_insns ();
>>              end_sequence ();
>
> Please use indirect functions here, see many examples in the code.
>
> OK with this change.
>
> Thanks,
> Uros.

This is the patch I checked in.

Thanks.


-- 
H.J.
---
2012-03-12  H.J. Lu  

* config/i386/i386.c (ix86_gen_tls_global_dynamic_64): New.
(ix86_gen_tls_local_dynamic_base_64): Likewise.
(ix86_option_override_internal): Set ix86_gen_tls_global_dynamic_64
and ix86_gen_tls_local_dynamic_base_64.
(legitimize_tls_address): Use ix86_gen_tls_global_dynamic_64 and
ix86_gen_tls_local_dynamic_base_64.

* config/i386/i386.md (*tls_global_dynamic_64): Renamed to ...
(*tls_global_dynamic_64_): This.
(tls_global_dynamic_64): Renamed to ...
(tls_global_dynamic_64_): This.
(*tls_local_dynamic_base_64): Renamed to ...
(*tls_local_dynamic_base_64_): This.
(tls_local_dynamic_base_64): Renamed to ...
(tls_local_dynamic_base_64_): This.
2012-03-12  H.J. Lu  

* config/i386/i386.c (ix86_gen_tls_global_dynamic_64): New.
(ix86_gen_tls_local_dynamic_base_64): Likewise.
(ix86_option_override_internal): Set ix86_gen_tls_global_dynamic_64
and ix86_gen_tls_local_dynamic_base_64.
(legitimize_tls_address): Use ix86_gen_tls_global_dynamic_64 and
ix86_gen_tls_local_dynamic_base_64.

* config/i386/i386.md (*tls_global_dynamic_64): Renamed to ...
(*tls_global_dynamic_64_): This.
(tls_global_dynamic_64): Renamed to ...
(tls_global_dynamic_64_): This.
(*tls_local_dynamic_base_64): Renamed to ...
(*tls_local_dynamic_base_64_): This.
(tls_local_dynamic_base_64): Renamed to ...
(tls_local_dynamic_base_64_): This.

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index d85dc25..dbcf5a9 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -2444,6 +2444,8 @@ static rtx (*ix86_gen_andsp) (rtx, rtx, rtx);
 static rtx (*ix86_gen_allocate_stack_worker) (rtx, rtx);
 static rtx (*ix86_gen_adjust_stack_and_probe) (rtx, rtx, rtx);
 static rtx (*ix86_gen_probe_stack_range) (rtx, rtx, rtx);
+static rtx (*ix86_gen_tls_global_dynamic_64) (rtx, rtx, rtx);
+static rtx (*ix86_gen_tls_local_dynamic_base_64) (rtx, rtx);
 
 /* Preferred alignment for stack boundary in bits.  */
 unsigned int ix86_preferred_stack_boundary;
@@ -3754,9 +3756,19 @@ ix86_option_override_internal (bool main_args_p)
 {
   ix86_gen_leave = gen_leave_rex64;
   if (Pmode == DImode)
- 

Re: Remove non-GAS non-ELF support in alpha backend

2012-03-12 Thread Joseph S. Myers
On Mon, 12 Mar 2012, Rainer Orth wrote:

> While having the osf removal patch reviewed, it turned out that with the
> last non-gas non-ELF alpha port gone, there's considerable cleanup
> potential in the alpha backend.  The following patch implements this:

I wonder whether it will be possible for a future cleanup to make alpha 
targets use toplevel elfos.h, and for Alpha GNU/Linux toplevel gnu-user.h 
and linux.h as well?

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: Remove non-GAS non-ELF support in alpha backend

2012-03-12 Thread Richard Henderson
On 03/12/12 09:57, Joseph S. Myers wrote:
> I wonder whether it will be possible for a future cleanup to make alpha 
> targets use toplevel elfos.h, and for Alpha GNU/Linux toplevel gnu-user.h 
> and linux.h as well?

Probably we can, at least to a fairly large degree.


r~


[Patch,AVR]; PR52499 fix MODE_CODE_BASE_REG_CLASS type

2012-03-12 Thread Georg-Johann Lay
This fixes a problem if avr-gcc is built with C++

Lightly tested.

Ok for trunk?

Johann

PR target/52499
* config/avr/avr.c (avr_mode_code_base_reg_class): Change return
type from reg_class_t to enum reg_class.
* config/avr/avr-protos.h (avr_mode_code_base_reg_class): Ditto.
Index: config/avr/avr-protos.h
===
--- config/avr/avr-protos.h	(revision 185099)
+++ config/avr/avr-protos.h	(working copy)
@@ -115,7 +115,7 @@ extern int avr_simplify_comparison_p (en
 extern RTX_CODE avr_normalize_condition (RTX_CODE condition);
 extern void out_shift_with_cnt (const char *templ, rtx insn,
 rtx operands[], int *len, int t_len);
-extern reg_class_t avr_mode_code_base_reg_class (enum machine_mode, addr_space_t, RTX_CODE, RTX_CODE);
+extern enum reg_class avr_mode_code_base_reg_class (enum machine_mode, addr_space_t, RTX_CODE, RTX_CODE);
 extern bool avr_regno_mode_code_ok_for_base_p (int, enum machine_mode, addr_space_t, RTX_CODE, RTX_CODE);
 extern rtx avr_incoming_return_addr_rtx (void);
 extern rtx avr_legitimize_reload_address (rtx*, enum machine_mode, int, int, int, int, rtx (*)(rtx,int));
Index: config/avr/avr.c
===
--- config/avr/avr.c	(revision 185100)
+++ config/avr/avr.c	(working copy)
@@ -8983,7 +8983,7 @@ avr_hard_regno_mode_ok (int regno, enum
 
 /* Implement `MODE_CODE_BASE_REG_CLASS'.  */
 
-reg_class_t
+enum reg_class
 avr_mode_code_base_reg_class (enum machine_mode mode ATTRIBUTE_UNUSED,
   addr_space_t as, RTX_CODE outer_code,
   RTX_CODE index_code ATTRIBUTE_UNUSED)


Remove DWARF_OFFSET_SIZE, DWARF_INITIAL_LENGTH_SIZE

2012-03-12 Thread Rainer Orth
With the IRIX port gone (shortly), there are no targets that define a
non-default DWARF_OFFSET_SIZE or DWARF_INITIAL_LENGTH_SIZE any longer.
I therefore propose to remove the code handling this.

The following (pretty mechanical) patch does this.  Bootstrapped without
regressions on i386-pc-solaris2.11, ok for mainline?

Rainer


2012-03-11  Rainer Orth  

* defaults.h (DWARF_OFFSET_SIZE): Remove.
* config/sparc/freebsd.h (DWARF_OFFSET_SIZE): Remove comment.
* config/sparc/linux64.h : Remove comment.
* config/sparc/linux64.h : Likewise.
* system.h (DWARF_OFFSET_SIZE): Poison.

* dwarf2out.c (DWARF_INITIAL_LENGTH_SIZE): Remove.
(DWARF_CIE_ID): Remove non-default DWARF_OFFSET_SIZE,
DWARF_INITIAL_LENGTH_SIZE handling.
(output_fde): Likewise.
(output_call_frame_info): Likewise.
(DWARF_REF_SIZE): Likewise.
(DWARF_COMPILE_UNIT_HEADER_SIZE): Likewise.
(DWARF_COMDAT_TYPE_UNIT_HEADER_SIZE): Likeiwise.
(DWARF_PUBNAMES_HEADER_SIZE): Likewise.
(DWARF_ARANGES_HEADER_SIZE): Likewise.
(DWARF_ARANGES_PAD_SIZE): Likewise.
(AT_string_form): Likewise.
(size_of_die): Likewise.
(size_of_pubnames): Likewise.
(value_format): Likewise.
(output_die): Likewise.
(output_compilation_unit_header): Likewise.
(output_comdat_type_unit): Likewise.
(output_pubnames): Likewise.
(output_aranges): Likewise.
(output_line_info): Likewise.
(output_macinfo_op): Likewise.
(optimize_macinfo_range): Likewise.
(output_macinfo): Likewise.

(DW_FORM_data): Remove.
(DW_FORM_ref): Remove.
(value_format): Replace DW_FORM_data by DW_FORM_data4.
Replace DW_FORM_ref by DW_FORM_ref4.

# HG changeset patch
# Parent 15a86d35ec84fea1404f4ca7d5f98f602c7dd70d
Remove DWARF_OFFSET_SIZE, DWARF_INITIAL_LENGTH_SIZE

diff --git a/gcc/config/sparc/freebsd.h b/gcc/config/sparc/freebsd.h
--- a/gcc/config/sparc/freebsd.h
+++ b/gcc/config/sparc/freebsd.h
@@ -1,5 +1,5 @@
 /* Definitions for Sun SPARC64 running FreeBSD using the ELF format
-   Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2010, 2011
+   Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2010, 2011, 2012
Free Software Foundation, Inc.
Contributed by David E. O'Brien  and BSDi.
 
@@ -124,15 +124,6 @@ along with GCC; see the file COPYING3.  
 #undef  DBX_CONTIN_CHAR
 #define DBX_CONTIN_CHAR	'?'
 
-/* DWARF bits.  */
-
-/* Follow Irix 6 and not the Dwarf2 draft in using 64-bit offsets. 
-   Obviously the Dwarf2 folks havn't tried to actually build systems
-   with their spec.  On a 64-bit system, only 64-bit relocs become
-   RELATIVE relocations.  */
-
-/* #define DWARF_OFFSET_SIZE PTR_SIZE */
-
 #ifdef HAVE_AS_TLS
 #undef TARGET_SUN_TLS
 #undef TARGET_GNU_TLS
diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
--- a/gcc/config/sparc/linux64.h
+++ b/gcc/config/sparc/linux64.h
@@ -1,6 +1,6 @@
 /* Definitions for 64-bit SPARC running Linux-based GNU systems with ELF.
Copyright 1996, 1997, 1998, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-   2009, 2010, 2011 Free Software Foundation, Inc.
+   2009, 2010, 2011, 2012 Free Software Foundation, Inc.
Contributed by David S. Miller (da...@caip.rutgers.edu)
 
 This file is part of GCC.
@@ -236,15 +236,6 @@ do {	\
 #undef  LOCAL_LABEL_PREFIX
 #define LOCAL_LABEL_PREFIX  "."
 
-/* DWARF bits.  */
-
-/* Follow Irix 6 and not the Dwarf2 draft in using 64-bit offsets. 
-   Obviously the Dwarf2 folks haven't tried to actually build systems
-   with their spec.  On a 64-bit system, only 64-bit relocs become
-   RELATIVE relocations.  */
-
-/* #define DWARF_OFFSET_SIZE PTR_SIZE */
-
 #undef DITF_CONVERSION_LIBFUNCS
 #define DITF_CONVERSION_LIBFUNCS 1
 
diff --git a/gcc/defaults.h b/gcc/defaults.h
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -462,14 +462,6 @@ see the files COPYING3 and COPYING.RUNTI
 #define DWARF2_ADDR_SIZE (POINTER_SIZE / BITS_PER_UNIT)
 #endif
 
-/* The size in bytes of a DWARF field indicating an offset or length
-   relative to a debug info section, specified to be 4 bytes in the
-   DWARF-2 specification.  The SGI/MIPS ABI defines it to be the same
-   as PTR_SIZE.  */
-#ifndef DWARF_OFFSET_SIZE
-#define DWARF_OFFSET_SIZE 4
-#endif
-
 /* The size in bytes of a DWARF 4 type signature.  */
 #ifndef DWARF_TYPE_SIGNATURE_SIZE
 #define DWARF_TYPE_SIGNATURE_SIZE 8
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -162,18 +162,6 @@ static GTY(()) section *debug_frame_sect
 /* Maximum size (in bytes) of an artificially generated label.  */
 #define MAX_ARTIFICIAL_LABEL_BYTES	30
 
-/* According to the (draft) DWARF 3 specification, the initial length
-   should either be 4 or 12 bytes.  When it's 12 bytes, the first 4
-   bytes are 0x, followed by the length stored in the next 8
-   bytes.
-
-   Howev

[Patch,AVR]: Fix PR52488 (insane stack usage)

2012-03-12 Thread Georg-Johann Lay
...and now to the right mailing list...

This patch cuts down insane stack offsets for 8-bit SP targets to a value the
involved insns can handle.

Background is that newlib generates such insane offsets (2050 bytes of stack
for a device with 128 bytes of RAM) because of extension PR51345, i.e. new
multilib variants for 8-bit SP targets.

The CFA notes still contain the original size as requested by the source so
that -Wstack-usage= will still work as intended.

The generated code will never be functional, of course, but there should never
be an ICE.

This patch is less aggressive than the patch proposed in the PR, i.e. it is
silent and does not issue an error so that newlib can still be built. If the
user wants additional sanity checking, he has to use -Wstack-usage= or similar
options.

Passed testsuite.

Ok for trunk?

Johann

PR target/52488
* config/avr/avr.c (avr_prologue_setup_frame): Cut down stack
offset (size) to a value the insns can deal with.
(expand_epilogue): Ditto.

Index: config/avr/avr.c
===
--- config/avr/avr.c	(revision 185100)
+++ config/avr/avr.c	(working copy)
@@ -827,7 +827,11 @@ avr_prologue_setup_frame (HOST_WIDE_INT
   bool isr_p = cfun->machine->is_interrupt || cfun->machine->is_signal;
   int live_seq = sequent_regs_live ();
 
+  HOST_WIDE_INT size_max
+= (HOST_WIDE_INT) GET_MODE_MASK (AVR_HAVE_8BIT_SP ? QImode : Pmode);
+
   bool minimize = (TARGET_CALL_PROLOGUES
+   && size < size_max
&& live_seq
&& !isr_p
&& !cfun->machine->is_OS_task
@@ -933,6 +937,7 @@ avr_prologue_setup_frame (HOST_WIDE_INT
   leaf function and thus X has already been saved.  */
   
   int irq_state = -1;
+  HOST_WIDE_INT size_cfa = size;
   rtx fp_plus_insns, fp, my_fp;
 
   gcc_assert (frame_pointer_needed
@@ -951,6 +956,27 @@ avr_prologue_setup_frame (HOST_WIDE_INT
   my_fp = all_regs_rtx[FRAME_POINTER_REGNUM];
 }
 
+  /* Cut down size and avoid size = 0 so that we don't run
+ into ICE like PR52488 in the remainder.  */
+
+  if (size > size_max)
+{
+  /* Don't error so that insane code from newlib still compiles
+ and does not break building newlib.  As PR51345 is implemented
+ now, there are multilib variants with -mtiny-stack.
+ 
+ If user wants sanity checks he can use -Wstack-usage=
+ or similar options.
+
+ For CFA we emit the original, non-saturated size so that
+ the generic machinery is aware of the real stack usage and
+ will print the above diagnostic as expected.  */
+  
+  size = size_max;
+}
+
+  size = trunc_int_for_mode (size, GET_MODE (my_fp));
+  
   /  Method 1: Adjust frame pointer  /
   
   start_sequence ();
@@ -975,7 +1001,7 @@ avr_prologue_setup_frame (HOST_WIDE_INT
   RTX_FRAME_RELATED_P (insn) = 1;
   add_reg_note (insn, REG_CFA_ADJUST_CFA,
 gen_rtx_SET (VOIDmode, fp,
- plus_constant (fp, -size)));
+ plus_constant (fp, -size_cfa)));
 }
   
   /* Copy to stack pointer.  Note that since we've already
@@ -1003,7 +1029,7 @@ avr_prologue_setup_frame (HOST_WIDE_INT
   add_reg_note (insn, REG_CFA_ADJUST_CFA,
 gen_rtx_SET (VOIDmode, stack_pointer_rtx,
  plus_constant (stack_pointer_rtx,
--size)));
+-size_cfa)));
 }
   
   fp_plus_insns = get_insns ();
@@ -1026,7 +1052,7 @@ avr_prologue_setup_frame (HOST_WIDE_INT
   add_reg_note (insn, REG_CFA_ADJUST_CFA,
 gen_rtx_SET (VOIDmode, stack_pointer_rtx,
  plus_constant (stack_pointer_rtx,
--size)));
+-size_cfa)));
   if (frame_pointer_needed)
 {
   insn = emit_move_insn (fp, stack_pointer_rtx);
@@ -1048,7 +1074,7 @@ avr_prologue_setup_frame (HOST_WIDE_INT
   emit_insn (fp_plus_insns);
 }
 
-  cfun->machine->stack_usage += size;
+  cfun->machine->stack_usage += size_cfa;
 } /* !minimize && size != 0 */
 } /* !minimize */
 }
@@ -1261,6 +1287,7 @@ expand_epilogue (bool sibcall_p)
   int irq_state = -1;
   rtx fp, my_fp;
   rtx fp_plus_insns;
+  HOST_

Fix sgi typos

2012-03-12 Thread Rainer Orth
While working on the IRIX 6.5 removal patch, I came across a couple of
typos.  Fixed as follows.

Will install as obvious, I only wonder what to do about the typo in
ACATS?

Rainer


2012-03-10  Rainer Orth  

libgcc:
* config/arm/crtn.S: Fix typo.

gcc/testsuite:
* ada/acats/tests/cd/cdd1001.a (CDD1001): Fix typo.

gcc:
* config/microblaze/microblaze.md: Fix typo.
* tree-if-conv.c: Likewise.
* tree-vect-patterns.c: Likewise.

# HG changeset patch
# Parent e0cba5670633af032245b95c9efe3254a8cf9eed
Fix sgi typos

diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
--- a/gcc/config/microblaze/microblaze.md
+++ b/gcc/config/microblaze/microblaze.md
@@ -1,5 +1,5 @@
 ;; microblaze.md -- Machine description for Xilinx MicroBlaze processors.
-;; Copyright 2009, 2010 Free Software Foundation, Inc.
+;; Copyright 2009, 2010, 2012 Free Software Foundation, Inc.
 
 ;; Contributed by Michael Eager .
 
@@ -1024,7 +1024,7 @@
   }
 )
 
-;; Added for status resgisters 
+;; Added for status registers
 (define_insn "movsi_status"
   [(set (match_operand:SI 0 "register_operand" "=d,d,z")
 (match_operand:SI 1 "register_operand" "z,d,d"))]
diff --git a/gcc/testsuite/ada/acats/tests/cd/cdd1001.a b/gcc/testsuite/ada/acats/tests/cd/cdd1001.a
--- a/gcc/testsuite/ada/acats/tests/cd/cdd1001.a
+++ b/gcc/testsuite/ada/acats/tests/cd/cdd1001.a
@@ -84,7 +84,7 @@ begin
 for I in B'Range loop
 	if B (I).all /= Stream_Element
 			   (Ident_Int (Integer (I)) * Ident_Int (3)) then
-	Failed ("Unable to build access values desginating elements " &
+	Failed ("Unable to build access values designating elements " &
 		"of a Stream_Element_Array");
 	end if;
 end loop;
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -1,5 +1,5 @@
 /* If-conversion for vectorizer.
-   Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Contributed by Devang Patel 
 
@@ -712,7 +712,7 @@ if_convertible_gimple_assign_stmt_p (gim
 /* Return true when STMT is if-convertible.
 
A statement is if-convertible if:
-   - it is an if-convertible GIMPLE_ASSGIN,
+   - it is an if-convertible GIMPLE_ASSIGN,
- it is a GIMPLE_LABEL or a GIMPLE_COND.  */
 
 static bool
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -462,7 +462,7 @@ vect_handle_widen_op_by_const (gimple st
 
where type 'TYPE' is at least double the size of type 'type'.
 
-   Also detect unsgigned cases:
+   Also detect unsigned cases:
 
  unsigned type a_t, b_t;
  unsigned TYPE u_prod_T;
diff --git a/libgcc/config/arm/crtn.S b/libgcc/config/arm/crtn.S
--- a/libgcc/config/arm/crtn.S
+++ b/libgcc/config/arm/crtn.S
@@ -1,4 +1,4 @@
-#   Copyright (C) 2001, 2004, 2008, 2009, 2010, 2011
+#   Copyright (C) 2001, 2004, 2008, 2009, 2010, 2011, 2012
 #   Free Software Foundation, Inc.
 #   Written By Nick Clifton
 # 
@@ -47,7 +47,7 @@
 	#
 	# Note - we do not try any fancy optimizations of the return
 	# sequences here, it is just not worth it.  Instead keep things
-	# simple.  Restore all the save resgisters, including the link
+	# simple.  Restore all the save registers, including the link
 	# register and then perform the correct function return instruction.
 	# We also save/restore r3 to ensure stack alignment.
 .macro FUNC_END


-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: Remove obsolete IRIX 6.5 support

2012-03-12 Thread Bruce Korb
On Mon, Mar 12, 2012 at 10:03 AM, Rainer Orth
 wrote:

I'm happy with the stuff going away!  :)


[RFA/ARM]: Correct Neon testsuite generation

2012-03-12 Thread Matthew Gretton-Dann
All,

The commit to fix PR51534 did not update the testsuite (as no changes were
expected there).

Unfortunately, this means that I didn't notice that the Neon testsuite generator
is broken.  The attached patch fixes the generator.

Checked by re-running the Neon testsuite and arm_neon.h generators and ensuring 
no
changes in the generated testsuite/header.

OK for trunk?

OK for backporting to GCC 4.7?

Thanks,

Matt

gcc/ChangeLog:

2012-03-12  Matthew Gretton-Dann  

* config/arm/neon.ml (ops): Fixup expected instructions for
unsigned vector compares.
-- 
Matthew Gretton-Dann
Principal Engineer, PD Software, ARM Ltd.diff --git a/gcc/config/arm/neon.ml b/gcc/config/arm/neon.ml
index 363e55c..85eb5ec 100644
--- a/gcc/config/arm/neon.ml
+++ b/gcc/config/arm/neon.ml
@@ -780,14 +780,19 @@ let ops =
 
 (* Comparison, greater-than or equal.  *)
 Vcge, [], All (3, Dreg), "vcge", cmp_sign_matters, F32 :: s_8_32;
-Vcge, [Builtin_name "vcgeu"], All (3, Dreg), "vcge", cmp_sign_matters, 
u_8_32;
+Vcge, [Instruction_name ["vcge"]; Builtin_name "vcgeu"],
+  All (3, Dreg), "vcge", cmp_sign_matters,
+  u_8_32;
 Vcge, [], All (3, Qreg), "vcgeQ", cmp_sign_matters, F32 :: s_8_32;
-Vcge, [Builtin_name "vcgeu"], All (3, Qreg), "vcgeQ", cmp_sign_matters, 
u_8_32;
+Vcge, [Instruction_name ["vcge"]; Builtin_name "vcgeu"],
+  All (3, Qreg), "vcgeQ", cmp_sign_matters,
+  u_8_32;
 
 (* Comparison, less-than or equal.  *)
 Vcle, [Flipped "vcge"], All (3, Dreg), "vcle", cmp_sign_matters,
   F32 :: s_8_32;
-Vcle, [Flipped "vcgeu"], All (3, Dreg), "vcle", cmp_sign_matters,
+Vcle, [Instruction_name ["vcge"]; Flipped "vcgeu"],
+  All (3, Dreg), "vcle", cmp_sign_matters,
   u_8_32;
 Vcle, [Instruction_name ["vcge"]; Flipped "vcgeQ"],
   All (3, Qreg), "vcleQ", cmp_sign_matters,
@@ -798,14 +803,19 @@ let ops =
 
 (* Comparison, greater-than.  *)
 Vcgt, [], All (3, Dreg), "vcgt", cmp_sign_matters, F32 :: s_8_32;
-Vcgt, [Builtin_name "vcgtu"], All (3, Dreg), "vcgt", cmp_sign_matters, 
u_8_32;
+Vcgt, [Instruction_name ["vcgt"]; Builtin_name "vcgtu"],
+  All (3, Dreg), "vcgt", cmp_sign_matters,
+  u_8_32;
 Vcgt, [], All (3, Qreg), "vcgtQ", cmp_sign_matters, F32 :: s_8_32;
-Vcgt, [Builtin_name "vcgtu"], All (3, Qreg), "vcgtQ", cmp_sign_matters, 
u_8_32;
+Vcgt, [Instruction_name ["vcgt"]; Builtin_name "vcgtu"],
+  All (3, Qreg), "vcgtQ", cmp_sign_matters,
+  u_8_32;
 
 (* Comparison, less-than.  *)
 Vclt, [Flipped "vcgt"], All (3, Dreg), "vclt", cmp_sign_matters,
   F32 :: s_8_32;
-Vclt, [Flipped "vcgtu"], All (3, Dreg), "vclt", cmp_sign_matters,
+Vclt, [Instruction_name ["vcgt"]; Flipped "vcgtu"],
+  All (3, Dreg), "vclt", cmp_sign_matters,
   u_8_32;
 Vclt, [Instruction_name ["vcgt"]; Flipped "vcgtQ"],
   All (3, Qreg), "vcltQ", cmp_sign_matters,

Re: [google/4.6] Add powerpc64-grtev2-linux-gnu.xfail (issue5794044)

2012-03-12 Thread Diego Novillo
On Fri, Mar 9, 2012 at 16:54, Doug Kwan  wrote:
> Hi Diego,
>
>    This patch adds the XFAIL file for powerpc64-grtev2-linux-gnu in 4.6.
>
> -Doug
>
> 2012-03-09   Doug Kwan  
>
>        * contrib/testsuite-management/powerpc64-grtev2-linux-gnu.xfail:
>        New file.

OK.  BTW, these failures are present in vanilla ppc64 builds as well?


Diego.


Re: Swap SECTION_EXCLUDE and SECTION_MACH_DEP

2012-03-12 Thread Sriraman Tallam
Hi Richard,

  Is this ok for trunk? Asking you because you approved the patch the
first time around.

Thanks,
-Sri.

On Fri, Mar 9, 2012 at 3:10 PM, Sriraman Tallam  wrote:
> Please see:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52545
>
> SECTION_EXCLUDE should not take up bits reserved for SECTION_MACH_DEP
>
> Patch:
>
>        PR 52545
>        * output.h (SECTION_MACH_DEP)
>        (SECTION_EXCLUDE):  Swap values.
>
>
>
> Index: output.h
> ===
> --- output.h    (revision 185120)
> +++ output.h    (working copy)
> @@ -446,8 +446,8 @@
>  #define SECTION_STYLE_MASK 0x60    /* bits used for SECTION_STYLE */
>  #define SECTION_COMMON   0x80      /* contains common data */
>  #define SECTION_RELRO   0x100      /* data is readonly after relocation
> processing */
> -#define SECTION_MACH_DEP 0x200     /* subsequent bits reserved for 
> target */
> -#define SECTION_EXCLUDE  0x400      /* discarded by the linker */
> +#define SECTION_EXCLUDE  0x200      /* discarded by the linker */
> +#define SECTION_MACH_DEP 0x400     /* subsequent bits reserved for 
> target */
>
> Ok to submit?
>
> Thanks.
> -Sri.
>
>
> On Fri, Mar 9, 2012 at 3:07 PM, Sriraman Tallam  wrote:
>>


Re: Swap SECTION_EXCLUDE and SECTION_MACH_DEP

2012-03-12 Thread Richard Henderson
On 03/12/12 10:26, Sriraman Tallam wrote:
> Hi Richard,
> 
>   Is this ok for trunk? Asking you because you approved the patch the
> first time around.
> 
> Thanks,
> -Sri.
> 
> On Fri, Mar 9, 2012 at 3:10 PM, Sriraman Tallam  wrote:
>> Please see:
>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52545
>>
>> SECTION_EXCLUDE should not take up bits reserved for SECTION_MACH_DEP
>>
>> Patch:
>>
>>PR 52545
>>* output.h (SECTION_MACH_DEP)
>>(SECTION_EXCLUDE):  Swap values.


Yes, this patch is ok


r~


libgcc gcov_fork failure on AIX

2012-03-12 Thread David Edelsohn
Richi,

Your patch for PR gcov/49484 now causes a bootstrap failure on AIX:

/farm/dje/src/src/libgcc/libgcov.c: In function '__gcov_fork':
/farm/dje/src/src/libgcc/libgcov.c:1008:5: error: 'mx' undeclared
(first use in this function)
/farm/dje/src/src/libgcc/libgcov.c:1008:5: note: each undeclared
identifier is reported only once for each function it appears in
make: *** [_gcov_fork.o] Error 1

# 1000 "/farm/dje/src/src/libgcc/libgcov.c"
pid_t
__gcov_fork (void)
{
  pid_t pid;
  extern __gthread_mutex_t __gcov_flush_mx;
  __gcov_flush ();
  pid = fork ();
  if (pid == 0)
(mx) (&__gcov_flush_mx);
  return pid;
}


Re: Remove obsolete IRIX 6.5 support

2012-03-12 Thread Joseph S. Myers
On Mon, 12 Mar 2012, Rainer Orth wrote:

>   * config/mips/mips-modes.def: Remove IRIX 6 reference.
>   * config/mips/gnu-user64.h (MIPS_TFMODE_FORMAT): Remove.
>   * config/mips/mips.c (mips_option_override) [MIPS_TFMODE_FORMAT]:
>   Remove.

I think this means that mips_extended_format in real.[ch] - the MIPS 
variant of IBM long double - is also obsolete, and with it all the support 
in fp-bit.[ch] for that format (__LDBL_MANT_DIG__ == 106 conditional, 
HALFFRACBITS, HALFSHIFT and associated conditional code).

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: [google/4.6] Add powerpc64-grtev2-linux-gnu.xfail (issue5794044)

2012-03-12 Thread 關振德
Don't know.  I am establishing the base line so that we can notice
regressions.  We will look at them closely one we started tracking the
tests.

-Doug

On Mon, Mar 12, 2012 at 10:23 AM, Diego Novillo  wrote:
> On Fri, Mar 9, 2012 at 16:54, Doug Kwan  wrote:
>> Hi Diego,
>>
>>    This patch adds the XFAIL file for powerpc64-grtev2-linux-gnu in 4.6.
>>
>> -Doug
>>
>> 2012-03-09   Doug Kwan  
>>
>>        * contrib/testsuite-management/powerpc64-grtev2-linux-gnu.xfail:
>>        New file.
>
> OK.  BTW, these failures are present in vanilla ppc64 builds as well?
>
>
> Diego.


Re: Remove DWARF_OFFSET_SIZE, DWARF_INITIAL_LENGTH_SIZE

2012-03-12 Thread Joseph S. Myers
On Mon, 12 Mar 2012, Rainer Orth wrote:

> With the IRIX port gone (shortly), there are no targets that define a
> non-default DWARF_OFFSET_SIZE or DWARF_INITIAL_LENGTH_SIZE any longer.
> I therefore propose to remove the code handling this.

As a *target macro* it makes sense to remove it - reomve it from 
defaults.h, make it purely internal to dwarf2out.c.  But I think it makes 
sense to have it inside dwarf2out.c - to indicate that a particular "4" is 
actually the size of an offset (which could be 8 if 64-bit DWARF were 
generated) rather than some other source of the magic number "4" (in 
general I think using meaningful names is better than such magic numbers, 
especially given that in the DWARF specification this is not a constant 
4).

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: [PATCH] Fix PR49484, gthr requirements update (target maintainers have a looksee)

2012-03-12 Thread Gerald Pfeifer
On Mon, 12 Mar 2012, Richard Guenther wrote:
>>> 2012-01-18  Richard Guenther  
>>>
>>>        * gthr.h (__GTHREAD_MUTEX_INIT_FUNCTION): Adjust specification.
>>>        * gthr-posix.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.
>>>        (__gthread_mutex_init_function): New function.
>>>        * gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.
>>>
>>>        PR gcov/49484
>>>        * libgcov.c: Include gthr.h.
>>>        (__gcov_flush_mx): New global variable.
>>>        (init_mx, init_mx_once): New functions.
>>>        (__gcov_flush): Protect self with a mutex.
>>>        (__gcov_fork): Re-initialize mutex after forking.
>>>        * unwind-dw2-fde.c: Change condition under which to use
>>>        __GTHREAD_MUTEX_INIT_FUNCTION.

Richi, I'm afraid this caused the following on i386-unknown-freebsd10?

/scratch2/tmp/gerald/gcc-HEAD/libgcc/libgcov.c:710:54: error: 'NULL' undeclared 
here (not in a function)
gmake[3]: *** [_gcov.o] Error 1
gmake[3]: *** Waiting for unfinished jobs
gmake[3]: Leaving directory 
`/scratch2/tmp/gerald/OBJ-0312-1454/i386-unknown-freebsd10.0/libgcc'
gmake[2]: *** [all-stage1-target-libgcc] Error 2

Gerald

RE: [Patch,AVR]; PR52499 fix MODE_CODE_BASE_REG_CLASS type

2012-03-12 Thread Weddington, Eric


> -Original Message-
> From: Georg-Johann Lay 
> Sent: Monday, March 12, 2012 11:08 AM
> To: gcc-patches@gcc.gnu.org
> Cc: Denis Chertykov; Weddington, Eric
> Subject: [Patch,AVR]; PR52499 fix MODE_CODE_BASE_REG_CLASS type
> 
> This fixes a problem if avr-gcc is built with C++
> 
> Lightly tested.
> 
> Ok for trunk?
> 

Please commit.


Remove obsolete Solaris 8 support

2012-03-12 Thread Rainer Orth
Since even extended support for Solaris 8 ends by March 31st, this patch
removes Solaris 8 support from mainline.  Given that extended support
for Solaris 9 lasts until October 2014, I guess that will remain in GCC
for at least one major release.

Again, I don't expect the patch to be controversial, but a few issues
bear mention:

* Although libgcc/config/sparc/sol2-unwind.h could be simplified quite a
  bit, perhaps we could go further: I wonder if the remaining nframes = 2
  case really applies to Solaris 9.  If not, one could massivly simplify
  this code.

* As in the IRIX case, I wonder if removing Solaris 8 support from libgo
  is a good idea while it still is supported on the 4.7 branch.

* In libstdc++, all checks for the presence of overloads can be replaced
  by hardcoded values.  This also allows __CORRECT_ISO_CPP_MATH_H_PROTO2
  to be removed and to drop the `1' in __CORRECT_ISO_CPP_MATH_H_PROTO1.

* I haven't yet checked if the Solaris references in
  libstdc++-v3/config/io/basic_file_stdio.cc are correct or also apply
  to newer versions.  This can probably wait for a later time.

* libstdc++-v3/doc/xml/manual/internals.xml still has various references
  to older Solaris versions.  I haven't touched those.

Bootstrapped without regressions on {i386-pc, sparc-sun}-solaris2.{9, 10, 11}
(Solaris 9/SPARC still running).  Ok for mainline if that passes (though
I guess I don't need approval for most of these changes)?

Thanks.
Rainer


2012-03-11  Rainer Orth  

libstdc++-v3:
* config/os/solaris/solaris2.8: Rename to ...
* config/os/solaris/solaris2.9: ... this.
* config/abi/post/solaris2.8: Rename to ...
* config/abi/post/solaris2.9: ... this.
* configure.host (os_include_dir): Remove solaris2.8.
Reflect renaming.
(abi_baseline_pair): Remove *-*-solaris2.8.
Reflect renaming.

* configure.ac (GLIBCXX_CHECK_MATH_PROTO): Remove
(GLIBCXX_CHECK_STDLIB_PROTO): Remove.
* acinclude.m4 (GLIBCXX_CHECK_MATH_PROTO): Remove
(GLIBCXX_CHECK_STDLIB_PROTO): Remove.
(GLIBCXX_CHECK_GTHREADS): Remove Solaris 8 handling.
* crossconfig.m4 (GLIBCXX_CROSSCONFIG): Remove *-solaris2.8
handling.
* configure: Regenerate.
* config.h.in: Regenerate.

* config/os/solaris/solaris2.9/os_defines.h
(__CORRECT_ISO_CPP_MATH_H_PROTO): Define.
(__CORRECT_ISO_CPP_STDLIB_H_PROTO): Define.
* include/c_global/cmath: Rename __CORRECT_ISO_CPP_MATH_H_PROTO1
to __CORRECT_ISO_CPP_MATH_H_PROTO.
[!__CORRECT_ISO_CPP_MATH_H_PROTO2]: Remove.
* include/tr1/cmath: Rename __CORRECT_ISO_CPP_MATH_H_PROTO1 to
__CORRECT_ISO_CPP_MATH_H_PROTO.

* doc/xml/manual/configure.xml (Configure, --enable-libstdcxx-threads):
Remove Solaris 8 reference.

* testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc:
Don't xfail on *-*-solaris2.8.
* testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/12.cc:
Likewise.
* testsuite/ext/enc_filebuf/char/13598.cc: Don't xfail on
*-*-solaris2.8.

libjava:
* configure.ac (THREADLIBS): Remove *-*-solaris2.8 handling.
* configure: Regenerate.

libgo:
* configure.ac (OSCFLAGS): Remove *-*-solaris2.8 handling.
(libgo_cv_lib_makecontext_stack_top): Remove
sparc*-*-solaris2.8* handling.
* configure: Regenerate.

libgcc:
* config/i386/sol2-unwind.h (x86_fallback_frame_state): Remove
Solaris 8 handling.
* config/sparc/sol2-unwind.h (sparc64_is_sighandler): Remove
Solaris 8 handling.
(sparc_is_sighandler): Likewise.

libcpp:
* lex.c: Remove Solaris 8 reference.

gcc/testsuite:
* g++.dg/warn/miss-format-1.C: Remove *-*-solaris2.8 handling.
* gcc.dg/c99-stdint-6.c: Likewise.
* gcc.dg/lto/20090210_0.c: Likewise.
* gcc.dg/pr28796-2.c: Don't skip on sparc*-sun-solaris2.8.
* gcc.dg/pragma-init-fini.c: Don't skip on i?86-*-solaris2.8.
* gcc.dg/pragma-init-fini-2.c: Likewise.
* gcc.dg/torture/pr47917.c: Remove *-*-solaris2.8 handling.
* gcc.target/i386/pr22076.c: Remove i?86-*-solaris2.8 handling.
* gcc.target/i386/pr22152.c: Likewise.
* gcc.target/i386/vect8-ret.c: Likewise.
* lib/target-supports.exp (add_options_for_tls): Remove Solaris 8
handling.

gcc:
* config.gcc (enable_obsolete): Remove *-*-solaris2.8*.
(*-*-solaris2.[0-8], *-*-solaris2.[0-8].*): Mark unsupported.
(i[34567]86-*-solaris2*, x86_64-*-solaris2.1[0-9]*): Remove
Solaris 8 support.
* configure.ac (gcc_cv_ld_hidden): Remove *-*-solaris2.8*.
(ld_tls_support): Remove Solaris 8 references.
(lwp_dir, lwp_spec): Remove support for alternate thread library.
* acinclude.m4 (gcc_cv_initfini_array): Re

RFC: PATCH: Add -maddress-mode=short|long for x86

2012-03-12 Thread H.J. Lu
Hi,

Trunk can now use SImode or DImode for Pmode with -mx32.  Pmode == SImode
will avoid many conversions from SImode to DImode:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50797

It will use 0x67 address size prefix instead.  This patch adds a new
command line option, -maddress-mode=short|long, for x86.  Any comments?

Thanks.


H.J.

2012-03-12  H.J. Lu  

* config/i386/i386-opts.h (pmode): New.

* config/i386/i386.c (ix86_option_override_internal): Properly
check and set ix86_pmode.

* config/i386/i386.h (Pmode): Check ix86_pmode instead of
TARGET_64BIT.

* config/i386/i386.opt (maddress-mode=): New.

* doc/invoke.texi: Document -maddress-mode=short|long for x86.

diff --git a/gcc/config/i386/i386-opts.h b/gcc/config/i386/i386-opts.h
index 3cc2253..eea85fd 100644
--- a/gcc/config/i386/i386-opts.h
+++ b/gcc/config/i386/i386-opts.h
@@ -71,6 +71,11 @@ enum cmodel {
   CM_LARGE_PIC /* No assumptions.  */
 };
 
+enum pmode {
+  PMODE_SI,/* Pmode == SImode. */
+  PMODE_DI /* Pmode == DImode. */
+};
+
 enum asm_dialect {
   ASM_ATT,
   ASM_INTEL
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index dbcf5a9..8d9c801 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -3172,6 +3172,17 @@ ix86_option_override_internal (bool main_args_p)
   else
 ix86_arch_specified = 1;
 
+  if (global_options_set.x_ix86_pmode)
+{
+  if ((TARGET_LP64 && ix86_pmode == PMODE_SI)
+  || (!TARGET_64BIT && ix86_pmode == PMODE_DI))
+   error ("address mode %qs not supported in the %s bit mode",
+  TARGET_64BIT ? "short" : "long",
+  TARGET_64BIT ? "64" : "32");
+}
+  else
+ix86_pmode = TARGET_LP64 ? PMODE_DI : PMODE_SI;
+
   if (!global_options_set.x_ix86_abi)
 ix86_abi = DEFAULT_ABI;
 
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index c77070b..3fcd209 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -1745,7 +1745,7 @@ do {  
\
 /* Specify the machine mode that pointers have.
After generation of rtl, the compiler makes no further distinction
between pointers and any other objects of this machine mode.  */
-#define Pmode (TARGET_64BIT ? DImode : SImode)
+#define Pmode (ix86_pmode == PMODE_DI ? DImode : SImode)
 
 /* A C expression whose value is zero if pointers that need to be extended
from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and
diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt
index 1d8dc44..29f1082 100644
--- a/gcc/config/i386/i386.opt
+++ b/gcc/config/i386/i386.opt
@@ -159,6 +159,20 @@ Enum(cmodel) String(32) Value(CM_32)
 EnumValue
 Enum(cmodel) String(kernel) Value(CM_KERNEL)
 
+maddress-mode=
+Target RejectNegative Joined Enum(pmode) Var(ix86_pmode) Init(PMODE_SI)
+Use given address mode
+
+Enum
+Name(pmode) Type(enum pmode)
+Known address mode (for use with the -maddress-mode= option):
+
+EnumValue
+Enum(pmode) String(short) Value(PMODE_SI)
+
+EnumValue
+Enum(pmode) String(long) Value(PMODE_DI)
+
 mcpu=
 Target RejectNegative Joined Undocumented Alias(mtune=) Warn(%<-mcpu=%> is 
deprecated; use %<-mtune=%> or %<-march=%> instead)
 
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 5f5397b..e9188db 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -634,7 +634,7 @@ Objective-C and Objective-C++ Dialects}.
 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
--mcmodel=@var{code-model} -mabi=@var{name} @gol
+-mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
 -m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol
 -msse2avx -mfentry -m8bit-idiv @gol
 -mavx256-split-unaligned-load -mavx256-split-unaligned-store}
@@ -13938,6 +13938,18 @@ be statically or dynamically linked.
 @opindex mcmodel=large
 Generate code for the large model.  This model makes no assumptions
 about addresses and sizes of sections.
+
+@item -maddress-mode=long
+@opindex maddress-mode=long
+Generate code for long address mode.  It is only supported for 64-bit
+and x32 environments.  This is the default address mode for 64-bit
+environment.
+
+@item -maddress-mode=short
+@opindex maddress-mode=short
+Generate code for short address mode.  It is only supported for 32-bit
+and x32 environments.  This is the default address mode for 32-bit and
+x32 environments.
 @end table
 
 @node i386 and x86-64 Windows Options


Re: [Fortran-dev, patch, committed] Minor fixes

2012-03-12 Thread Tobias Burnus

On 03/12/2012 01:50 PM, Tobias Burnus wrote:
Additionally, I modified some tree-dump patterns for the extent and 
for the base_addr change.


Three more changes: The libgfortran change should have been just a 
cleanup, but it seems to also fix a failure. Plus two dump changes. The 
number of failures is now down to 160 FAIL lines - or to the following 
18 test cases (plus three which fail also on the trunk):


gfortran.dg/c_f_pointer_complex.f03
gfortran.dg/c_f_pointer_shape_tests_2.f03
gfortran.dg/c_f_pointer_shape_tests_4.f03
gfortran.dg/c_f_pointer_tests.f90
gfortran.dg/c_f_pointer_tests_4.f90
gfortran.dg/optional_dim_3.f90
gfortran.dg/associated_2.f90
gfortran.dg/auto_char_dummy_array_1.f90
gfortran.dg/class_array_1.f03
gfortran.dg/auto_char_len_3.f90
gfortran.dg/class_array_1.f03
gfortran.dg/class_array_2.f03
gfortran.dg/class_array_3.f03
gfortran.dg/class_to_type_1.f03
gfortran.dg/proc_decl_23.f90
gfortran.dg/read_eof_all.f90
gfortran.dg/transfer_intrinsic_3.f90
gfortran.dg/subref_array_pointer_2.f90

The array c_f_pointer function fails because the fptr's size is not set 
(it is needed to set the sm). Solution: Handle everything in the FE.


Tobias
Index: libgfortran/ChangeLog.fortran-dev
===
--- libgfortran/ChangeLog.fortran-dev	(revision 185216)
+++ libgfortran/ChangeLog.fortran-dev	(working copy)
@@ -1,5 +1,9 @@
 2012-03-12  Tobias Burnus  
 
+	* intrinsics/spread_generic.c (spread_internal): Properly use "sm".
+
+2012-03-12  Tobias Burnus  
+
 	* intrinsics/iso_c_binding.c (c_f_pointer_u0): Use
 	GFC_DESCRIPTOR_SM instead of GFC_DESCRIPTOR_STRIDE_BYTES.
 
Index: libgfortran/intrinsics/spread_generic.c
===
--- libgfortran/intrinsics/spread_generic.c	(revision 185199)
+++ libgfortran/intrinsics/spread_generic.c	(working copy)
@@ -71,18 +71,18 @@ spread_internal (gfc_array_char *ret, const gfc_ar
   /* The front end has signalled that we need to populate the
 	 return array descriptor.  */
 
-  size_t ub, stride;
+  size_t ext, sm;
 
   ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rrank;
   dim = 0;
-  rs = 1;
+  rs = size;
   for (n = 0; n < rrank; n++)
 	{
-	  stride = rs;
+	  sm = rs;
 	  if (n == *along - 1)
 	{
-	  ub = ncopies - 1;
-	  rdelta = rs * size;
+	  ext = ncopies;
+	  rdelta = rs;
 	  rs *= ncopies;
 	}
 	  else
@@ -90,17 +90,17 @@ spread_internal (gfc_array_char *ret, const gfc_ar
 	  count[dim] = 0;
 	  extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim);
 	  sstride[dim] = GFC_DESCRIPTOR_SM(source,dim);
-	  rstride[dim] = rs * size;
+	  rstride[dim] = rs;
 
-	  ub = extent[dim]-1;
+	  ext = extent[dim];
 	  rs *= extent[dim];
 	  dim++;
 	}
 
-	  GFC_DIMENSION_SET (ret->dim[n], 0, ub, stride*size);
+	  GFC_DIMENSION_SET (ret->dim[n], 0, ext, sm);
 	}
   ret->offset = 0;
-  ret->base_addr = internal_malloc_size (rs * size);
+  ret->base_addr = internal_malloc_size (rs);
 
   if (rs <= 0)
 	return;
Index: gcc/testsuite/gfortran.dg/internal_pack_4.f90
===
--- gcc/testsuite/gfortran.dg/internal_pack_4.f90	(revision 185197)
+++ gcc/testsuite/gfortran.dg/internal_pack_4.f90	(working copy)
@@ -26,7 +26,7 @@ USE M1
 CALL S2()
 END
 
-! { dg-final { scan-tree-dump-times "a != 0B \\? \\\(.*\\\) _gfortran_internal_pack" 1 "original" } }
-! { dg-final { scan-tree-dump-times "if \\(a != 0B &&" 1 "original" } }
+! { dg-final { scan-tree-dump-times " a != 0B && \\(real\\(kind=.\\).0:. . restrict\\) a->base_addr != 0B \\? \\\(.*\\\) _gfortran_internal_pack" 1 "original" } }
+! { dg-final { scan-tree-dump-times "if \\(\\(a != 0B && \\(real\\(kind=.\\).0:. . restrict\\) a->base_addr != 0B\\) &&" 1 "original" } }
 ! { dg-final { cleanup-tree-dump "original" } }
 ! { dg-final { cleanup-modules "m1" } }
Index: gcc/testsuite/gfortran.dg/assign_10.f90
===
--- gcc/testsuite/gfortran.dg/assign_10.f90	(revision 185197)
+++ gcc/testsuite/gfortran.dg/assign_10.f90	(working copy)
@@ -23,6 +23,6 @@ end
 ! cases will all yield a temporary, so that atmp appears 18 times.
 ! Note that it is the kind conversion that generates the temp.
 !
-! { dg-final { scan-tree-dump-times "parm" 18 "original" } }
-! { dg-final { scan-tree-dump-times "atmp" 18 "original" } }
+! { dg-final { scan-tree-dump-times "parm" 20 "original" } }
+! { dg-final { scan-tree-dump-times "atmp" 20 "original" } }
 ! { dg-final { cleanup-tree-dump "original" } }
Index: gcc/testsuite/ChangeLog.fortran-dev
===
--- gcc/testsuite/ChangeLog.fortran-dev	(revision 185225)
+++ gcc/testsuite/ChangeLog.fortran-dev	(working copy)
@@ -1,5 +1,10 @@
 2012-03-12  Tobias Burnus  
 
+	* gfortran.dg/assign_10.f90: Update scan-tre

[Patch,AVR.testsuite,committed]: More test for address spaces (PR49868)

2012-03-12 Thread Georg-Johann Lay
http://gcc.gnu.org/viewcvs?view=revision&revision=185255

This adds some test cases for the address space support.

Some tests fail because of PR other/52545.

Moreover, you will have to update the avrtest simulator because the test case
for __flash1 needs its own linker script in order to locate .progmem1.data* at
0x1.

Johann


Re: [Patch ARM/ configury] Add fall-back check for gnu_unique_object

2012-03-12 Thread DJ Delorie

Looks OK to me.


[PATCH][Cilkplus] Elemental Function Mangling

2012-03-12 Thread Iyer, Balaji V
Hello Everyone,
  This patch is for the Cilkplus branch mainly affecting the C compiler. 
This patch will do the vector function mangling correctly for elemental 
functions.

Thanking You,

Yours Sincerely,

Balaji V. Iyer.diff --git a/gcc/ChangeLog.cilk b/gcc/ChangeLog.cilk
index 1398870..c1b1d71 100644
--- a/gcc/ChangeLog.cilk
+++ b/gcc/ChangeLog.cilk
@@ -1,3 +1,20 @@
+2012-03-11  Balaji V. Iyer  
+
+   * attribs.c (decl_attributes): Concatinated existing attributes with
+   vector attributes.
+   * c-decl.c (bind): Added a check if scope is not null.
+   * elem-function.c (rename_elm_fn): New function.
+   (is_elem_fn): Likewise.
+   (find_processor_code): Likewise.
+   (find_vlength_code): Likewise.
+   (create_processor_attribute): Likewise.
+   (create_optimize_attribute): Likewise.
+   (find_suffix): Likewise.
+   (create_elem_fn_nodes): Likewise.
+   (extract_elem_fn_values): Likewise.
+   (create_elem_vec_fn): Likewise.
+   * passes.c (init_optimization_passes): Added elemental function pass.
+
 2012-03-09  Balaji V. Iyer  
 
* attribs.c (decl_attributes): Added a check for elemental function
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 0da06b3..ada4090 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1453,6 +1453,7 @@ OBJS = \
 cilk.o \
 cilk-low.o \
array-notation-common.o \
+   elem-function.o \
$(out_object_file) \
$(EXTRA_OBJS) \
$(host_hook_obj)
@@ -3436,7 +3437,8 @@ lower-subreg.o : lower-subreg.c $(CONFIG_H) $(SYSTEM_H) 
coretypes.h \
insn-config.h $(BASIC_BLOCK_H) $(RECOG_H) $(OBSTACK_H) $(BITMAP_H) \
$(EXPR_H) $(EXCEPT_H) $(REGS_H) $(TREE_PASS_H) $(DF_H) dce.h
 
-
+elem-function.o: elem-function.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(GIMPLE_H) 
\
+  $(OPTABS_H) $(RECOG_H)
 
 array-notation-common.o: array-notation-common.c $(CONFIG_H) $(SYSTEM_H) \
 $(TREE_H) $(RTL_H) $(OPTABS_H) $(GIMPLE_H) $(RECOG_H) 
diff --git a/gcc/attribs.c b/gcc/attribs.c
index 2ececc4..13c1417 100644
--- a/gcc/attribs.c
+++ b/gcc/attribs.c
@@ -327,6 +327,12 @@ decl_attributes (tree *node, tree attributes, int flags)
  if (!is_elem_fn_attribute_p (name))
warning (OPT_Wattributes, "%qE attribute directive ignored",
 name);
+ else
+   {
+ returned_attrs = tree_cons (name, args, returned_attrs);
+ DECL_ATTRIBUTES (*anode) = tree_cons (name, args,
+   DECL_ATTRIBUTES (*anode));
+   }
  continue;
}
   else if (list_length (args) < spec->min_length
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 4abf738..6251bee 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -620,7 +620,8 @@ bind (tree name, tree decl, struct c_scope *scope, bool 
invisible,
   b->shadowed = 0;
   b->decl = decl;
   b->id = name;
-  b->depth = scope->depth;
+  if (scope)
+b->depth = scope->depth;
   b->invisible = invisible;
   b->nested = nested;
   b->inner_comp = 0;
@@ -629,8 +630,11 @@ bind (tree name, tree decl, struct c_scope *scope, bool 
invisible,
 
   b->u.type = NULL;
 
-  b->prev = scope->bindings;
-  scope->bindings = b;
+  if (scope)
+{
+  b->prev = scope->bindings;
+  scope->bindings = b;
+}
 
   if (decl_jump_unsafe (decl))
 scope->has_jump_unsafe_decl = 1;
@@ -658,9 +662,11 @@ bind (tree name, tree decl, struct c_scope *scope, bool 
invisible,
   /* Locate the appropriate place in the chain of shadowed decls
  to insert this binding.  Normally, scope == current_scope and
  this does nothing.  */
-  while (*here && (*here)->depth > scope->depth)
-here = &(*here)->shadowed;
-
+  if (scope)
+{
+  while (*here && (*here)->depth > scope->depth)
+   here = &(*here)->shadowed;
+}
   b->shadowed = *here;
   *here = b;
 }
diff --git a/gcc/c-family/ChangeLog.cilk b/gcc/c-family/ChangeLog.cilk
index a4049d0..08d4c2d 100644
--- a/gcc/c-family/ChangeLog.cilk
+++ b/gcc/c-family/ChangeLog.cilk
@@ -1,3 +1,7 @@
+2012-03-11  Balaji V. Iyer  
+
+   * c-common.c (handle_vector_attribute): New function.
+
 2012-01-20  Balaji V. Iyer  
 
* c-common.c (c_define_builtins): Added a call to
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index f84ccb9..47b5c54 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -381,6 +381,7 @@ static tree handle_type_generic_attribute (tree *, tree, 
tree, int, bool *);
 static tree handle_alloc_size_attribute (tree *, tree, tree, int, bool *);
 static tree handle_target_attribute (tree *, tree, tree, int, bool *);
 static tree handle_optimize_attribute (tree *, tree, tree, int, bool *);
+static tree handle_vector_attribute (tree *, tree, tree, int, bool *);
 static tree ignore_attribute (tree *, tree, tree, int, bool *);
 static tree handle_no_split_stack_attribute (tree *, tree, tree, int, bool *);
 static tree handle_fnspec_attribute 

Re: Remove obsolete IRIX 6.5 support

2012-03-12 Thread Ian Lance Taylor
Rainer Orth  writes:

> * I'm removing IRIX-specific parts of libgo.  Given that libgo is
>   imported from upstream (and supposed to work or made work on the 4.7
>   branch), I don't know if this a good idea.

Yeah, it's not.  Just send me the mainline patches to libgo rather than
applying them yourself, I'll apply them to the upstream repository and
commit to mainline.

Thanks for working on this!

Ian


Re: Swap SECTION_EXCLUDE and SECTION_MACH_DEP

2012-03-12 Thread Sriraman Tallam
 Already submitted by gjl in rev. 185259.

-Sri.

On Mon, Mar 12, 2012 at 10:27 AM, Richard Henderson  wrote:
> On 03/12/12 10:26, Sriraman Tallam wrote:
>> Hi Richard,
>>
>>   Is this ok for trunk? Asking you because you approved the patch the
>> first time around.
>>
>> Thanks,
>> -Sri.
>>
>> On Fri, Mar 9, 2012 at 3:10 PM, Sriraman Tallam  wrote:
>>> Please see:
>>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52545
>>>
>>> SECTION_EXCLUDE should not take up bits reserved for SECTION_MACH_DEP
>>>
>>> Patch:
>>>
>>>        PR 52545
>>>        * output.h (SECTION_MACH_DEP)
>>>        (SECTION_EXCLUDE):  Swap values.
>
>
> Yes, this patch is ok
>
>
> r~


  1   2   >