Re: [patch, libgfortran] PR56743 Namelist bug with comment and no blank

2013-05-05 Thread Janus Weil
2013/5/5 Jerry DeLisle :
> On 05/04/2013 06:30 PM, Steve Kargl wrote:
>> On Sat, May 04, 2013 at 05:13:51PM -0700, Jerry DeLisle wrote:
>>>
>>>  CASE_SEPARATORS:/* Not a repeat count.  */
>>>  case EOF:
>>> +case '!':
>>
>>   if (c == '!')
>>  gfc_warning("GNU Fortran extension: accepting a possibly "
>>  "corrupted namelist");
>
> --- SNIP ---
>
>> I would prefer that gfortran issues an error.
>> Issuing a warning is acceptable.
>> Patch as is not OK IMHO.
>>
>> PS: A vendor extension should be documented in the manual.
>>
>
> I don't see much point in issuing a warning if we accept it.  I can just as
> easily make it an error with something like "A value separator is required
> before a namelist comment" and be done with trying to second guess whether
> someone is using namelists right or not.
>
> An error would be most consistent across all variable kinds.
>
> Any other opinions out there?

How about throwing an error only with -std=f2008 and friends, and
accepting it as an extension with -std=gnu?

I find it a bit surprising that the standard requires a blank there,
since it doesn't require a blank in such a situation in Fortran source
code (right?). If there is no technical reason to reject it, we might
as well always allow it if you ask me. But also a run-time error would
certainly be an improvement over the current behavior ...

Thanks for the patch,
Janus


Re: [PATCH] Fix latent bug in RTL GCSE/PRE (PR57159)

2013-05-05 Thread Steven Bosscher
On Fri, May 3, 2013 at 3:10 PM, Julian Brown wrote:
> gcc/
> * gcse.c (compute_ld_motion_mems): Invalidate non-simple mem refs
> in REG_EQUAL notes.

Makes sense to me. Looking at REG_EQUAL notes in hash_scan_set is
something relatively new. Your patch fixes something we appear to have
overlooked.

Ciao!
Steven


[C+ patch, committed as obvious] Add missing whitespace

2013-05-05 Thread Paolo Carlini

Hi,

committed to mainline.

Thanks,
Paolo.

///
2013-05-05  Paolo Carlini  

* pt.c (convert_nontype_argument): Add missing whitespace in
error message.
Index: pt.c
===
--- pt.c(revision 198607)
+++ pt.c(working copy)
@@ -5651,7 +5651,7 @@ convert_nontype_argument (tree type, tree expr, ts
}
  if (POINTER_TYPE_P (expr_type))
{
- error ("%qE is not a valid template argument for %qT"
+ error ("%qE is not a valid template argument for %qT "
 "because it is not the address of a variable",
 expr, type);
  return NULL_TREE;


Re: [PATCH SH] Fix PR57108

2013-05-05 Thread Oleg Endo
Hi,

On Mon, 2013-04-29 at 11:31 +0200, Christian Bruel wrote:
> Hello,
> 
> This patches set the correct operand mode for tstsi_t_zero_extract_eq,
> to avoid reload generating a move between a constant and a void register.
> 
> Reg tested for sh-elf. No performance impact

Unfortunately after your patch the test case for PR 49263 showed some
failures for SH2A and SH4A ('tst #imm,R0' insn not utilized in some
cases).

The operand mode in the tstsi_t_zero_extract_eq pattern was void on
purpose to match any mode (at least QI HI SI DI).  The attached patch
fixes that.  
OK for trunk and 4.8 if it passes testing?  (I'd leave 4.7 alone since
it doesn't have the iterators.md).

(BTW, I think the test case for this PR should have went into c-torture
instead of target/sh ...)


Cheers,
Oleg

gcc/ChangeLog:

PR target/57108
* config/sh/sh.md (tstsi_t_zero_extract_eq): Use QIHISIDI mode 
iterator.
Index: gcc/config/sh/sh.md
===
--- gcc/config/sh/sh.md	(revision 198595)
+++ gcc/config/sh/sh.md	(working copy)
@@ -687,9 +687,9 @@
   [(set_attr "type" "mt_group")])
 
 ;; Extract contiguous bits and compare them against zero.
-(define_insn "tstsi_t_zero_extract_eq"
+(define_insn "tst_t_zero_extract_eq"
   [(set (reg:SI T_REG)
-	(eq:SI (zero_extract:SI (match_operand:SI 0 "logical_operand" "z")
+	(eq:SI (zero_extract:SI (match_operand:QIHISIDI 0 "logical_operand" "z")
 (match_operand:SI 1 "const_int_operand")
 (match_operand:SI 2 "const_int_operand"))
 	   (const_int 0)))]


Re: [patch, libgfortran] PR56743 Namelist bug with comment and no blank

2013-05-05 Thread Tobias Burnus

Janus Weil wrote:

2013/5/5 Jerry DeLisle :

On 05/04/2013 06:30 PM, Steve Kargl wrote:

On Sat, May 04, 2013 at 05:13:51PM -0700, Jerry DeLisle wrote:

  CASE_SEPARATORS:/* Not a repeat count.  */
  case EOF:
+case '!':

   if (c == '!')
  gfc_warning("GNU Fortran extension: accepting a possibly "
  "corrupted namelist");

I would prefer that gfortran issues an error.
Issuing a warning is acceptable.
Patch as is not OK IMHO.

PS: A vendor extension should be documented in the manual.


I don't see much point in issuing a warning if we accept it.  I can just as
easily make it an error with something like "A value separator is required
before a namelist comment" and be done with trying to second guess whether
someone is using namelists right or not.

An error would be most consistent across all variable kinds.

Any other opinions out there?

How about throwing an error only with -std=f2008 and friends, and
accepting it as an extension with -std=gnu?


I personally do not like modified run-time behaviour, depending on 
-std=, as it can be very confusing. Especially as it depends only on the 
compile-time options used for the Fortran main program and not on the 
flags used for compiling the file. I also do not like the warning.


On the other hand, I am fine with either accepting "!" comments without 
blank as vendor extension and with unconditionally printing an error.


In any case, the patch is an improvement to the current situation of 
silently ignoring that entry. (Printing an error would be likewise an 
improvement.)


Tobias


Re: [patch, libgfortran] PR56743 Namelist bug with comment and no blank

2013-05-05 Thread Steve Kargl
On Sat, May 04, 2013 at 10:25:19PM -0700, Jerry DeLisle wrote:
> On 05/04/2013 06:30 PM, Steve Kargl wrote:
> > On Sat, May 04, 2013 at 05:13:51PM -0700, Jerry DeLisle wrote:
> >>  
> >>CASE_SEPARATORS:/* Not a repeat count.  */
> >>case EOF:
> >> +  case '!':
> > 
> >   if (c == '!')
> >  gfc_warning("GNU Fortran extension: accepting a possibly "
> >  "corrupted namelist");
> 
> --- SNIP ---
> 
> > I would prefer that gfortran issues an error.
> > Issuing a warning is acceptable.
> > Patch as is not OK IMHO.
> > 
> > PS: A vendor extension should be documented in the manual.
> >
> 
> I don't see much point in issuing a warning if we accept it.

Point 1.  If the standard requires a valid separator before !
  then gfortran should complain about the nonconforming
  namelist.  Silently violating the standard just seems
  wrong to me.

Point 2. By issuing the warning, the user will be alerted to the
 nonconforming namelist and may then be motivated to
 fix the problem for portability.

>  I can just as
> easily make it an error with something like "A value separator is required
> before a namelist comment" and be done with trying to second guess whether
> someone is using namelists right or not.

Issuing an error is my preference.  Issuing a warning is also
acceptable.  Silently aceepting the code seems wrong.  Do we
know what other compilers do?

-- 
Steve


*ping* Re: [Patch, Fortran] Avoid segfault in conformable_arrays

2013-05-05 Thread Tobias Burnus

Ping.
http://gcc.gnu.org/ml/fortran/2013-04/msg00272.html

Also pending: use-associated NULL() at 
http://gcc.gnu.org/ml/fortran/2013-05/msg6.html


Tobias Burnus wrote:
The issue was found by Reinhold Bader when testing the Fortran-Dev 
branch (thanks!), but it also affects GCC 4.6 and later.


The patch is rather obvious: The segfault occured as 
tail->u.ar.start[i] == NULL. An alternative is to could use "continue" 
instead of "break".


Build and regtested on x86-64-gnu-linux.
OK for the trunk?

Tobias

PS: The test case is invalid Fortran 2003 but valid Fortran 2008. As 
gfortran lacks that feature, it unconditionally rejects the test case. 
Work around is to add a "(1)" to the alloc-expr.




Re: *ping* Re: [Patch, Fortran] Avoid segfault in conformable_arrays

2013-05-05 Thread Thomas Koenig

Hi Tobias,


Ping.
http://gcc.gnu.org/ml/fortran/2013-04/msg00272.html


OK.


Also pending: use-associated NULL() at
http://gcc.gnu.org/ml/fortran/2013-05/msg6.html


Also OK (obvious really ;-)

Thanks for the patches!

Thomas



Re: RFC: PATCH to avoid linking multiple front ends at once with parallel make

2013-05-05 Thread Dave Korn
On 01/05/2013 03:02, Jason Merrill wrote:
> Since GNU Make doesn't support anything like the .MUTEX directive
> (http://savannah.gnu.org/bugs/?func=detailitem&item_id=17873), and
> accidentally doing "make -j8 -l4" makes my laptop useless for several
> minutes while it tries to link all the front ends at once, I decided to
> kludge a workaround.
> 
> This hack uses mkdir as a locking mechanism, as it fails if the
> directory already exists.  Each front-end rule first tries to get the
> lock, and spins if the lock isn't available.  Currently I'm enabling the
> locking by default on build hosts with less than 8GB of memory.
> 
> Releasing the lock is not reliable; if the user interrupts the link with
> ^C, the lock will remain.  So I adjusted 'make all' to remove the lock
> early on, though that only works for the typical case, and users that do
> something like 'make cc1plus' could still run into trouble.
> 
> Thoughts?  Is this too horrible a hack, or does it seem like something
> we might want?
> 
> Maybe I should fix Make instead.

  This sounds like a bad idea to me, and not just because the locking
mechanism is dodgy.  Is the problem more widespread than just your laptop?
Does it affect other host OSs?  Linking multiple frontends at once doesn't
lock up my desktop PC, so I'd rather not have it disabled.

  Why don't you just nice your build shell?  Shouldn't that make the rest of
your system responsive?

cheers,
  DaveK



Re: [PATCH SH] Fix PR57108

2013-05-05 Thread Kaz Kojima
Oleg Endo  wrote:
> The operand mode in the tstsi_t_zero_extract_eq pattern was void on
> purpose to match any mode (at least QI HI SI DI).  The attached patch
> fixes that.  
> OK for trunk and 4.8 if it passes testing?  (I'd leave 4.7 alone since
> it doesn't have the iterators.md).

OK.

> (BTW, I think the test case for this PR should have went into c-torture
> instead of target/sh ...)

Sounds plausible.

Regards,
kaz


Re: [build, driver] RFC: Support compressed debug sections

2013-05-05 Thread Joseph S. Myers
I still have no idea from your answer how a user is meant to know whether 
to use the option when compiling, linking or both, which is what needs to 
be clear from invoke.texi.

What does it mean for the option to be supported for compiling but not 
linking?  What in that case will the linker do with compressed debug 
sections on input?  Combine them in some way, good or bad?  Uncompress 
them?

Likewise, for it to be supported for linking but not compiling?  Will the 
linker then compress the uncompressed sections it receives on input?

I think it would be better if the option semantics are more like "if you 
pass the same option when both compiling and linking, the linked output 
will have the sections appropriately compressed as specified by the 
option, whether or not the individual .o files do" - and if this can't be 
supported with the tools being used, don't allow the option.

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


Re: powerpc64le-linux support

2013-05-05 Thread Joseph S. Myers
On Sun, 5 May 2013, Alan Modra wrote:

> Something to consider for the future is making more of the -mcall
> options endian agnostic, like -mcall-sysv.  Tested with a number of
> powerpc ELF builds.

I'd like to suggest removing those -mcall-* options (as far as they affect 
specs, anyway).  No other architecture has that sort of arrangement of 
embedding specs for lots of different OSes into a single compiler driver, 
and I don't think that approach is any sort of useful partial progress 
towards generic multi-target compiler support.  Without this PowerPC 
peculiarity, I expect it would be possible to use config/gnu-user.h and 
config/linux.h the way all GNU/Linux architectures other than Alpha and 
PowerPC do, so eliminating an unnecessary source of complication in global 
changes.

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


Re: powerpc64le-linux support

2013-05-05 Thread David Edelsohn
On Sun, May 5, 2013 at 12:35 AM, Alan Modra  wrote:
> This fixes a couple more little-endian bugs.  bswapdi stores when
> !TARGET_LDBRX were being split to two bswapsi but written to the wrong
> words because we word swapped twice.  ashrdi3 resulted in a libcall.
>
> I think I have ashrdi3_no_power correct.  For LE, the first reg of a
> register pair is the low word, the second the high word, and you use
> %L to select the high reg.  (For BE the second reg is the low word and
> %L really does stand for low).  So a quick rule of thumb for
> converting big-endian register pair patterns to little-endian is
> replace all the reg pair %n with %Ln and all %Ln with %n.
>
> * config/rs6000/rs6000.md (bswapdi 2nd splitter): Don't swap words
> twice for little-endian.
> (ashrdi3_no_power, ashrdi3): Support little-endian.

This is okay.

Thanks, David


Re: powerpc64le-linux support

2013-05-05 Thread David Edelsohn
On Sun, May 5, 2013 at 10:21 AM, Joseph S. Myers
 wrote:
> On Sun, 5 May 2013, Alan Modra wrote:
>
>> Something to consider for the future is making more of the -mcall
>> options endian agnostic, like -mcall-sysv.  Tested with a number of
>> powerpc ELF builds.
>
> I'd like to suggest removing those -mcall-* options (as far as they affect
> specs, anyway).  No other architecture has that sort of arrangement of
> embedding specs for lots of different OSes into a single compiler driver,
> and I don't think that approach is any sort of useful partial progress
> towards generic multi-target compiler support.  Without this PowerPC
> peculiarity, I expect it would be possible to use config/gnu-user.h and
> config/linux.h the way all GNU/Linux architectures other than Alpha and
> PowerPC do, so eliminating an unnecessary source of complication in global
> changes.

The -mcall-* options are more about PPC eABI.

I'm also am hesitant to remove such a feature without a deprecation
round and the little-endian fixes cannot be delayed for the -mcall-*
options to be deprecated.

I do not have a strong desire to keep them, but I don't think we can drop them.

I suspect that -mcall-*bsd and -mcall-aixdesc can be removed, but
there may be uses of -mcall-linux and -mcall-sysv related to eABI.

Thanks, David


Re: [PATCH 1/9] Improve pointer hash function to include all bits

2013-05-05 Thread Andi Kleen
> +  a += v >> (sizeof (intptr_t) * CHAR_BIT / 2);
> +  b += v & (((intptr_t) 1 << (sizeof (intptr_t) * CHAR_BIT / 2)) - 1);

It would be far easier to read if you added a BITS_PER_POINTER define
somewhere. Other than that it looks good to me, but I cannot approve.
-Andi


[PATCH 1/n, i386]: Improve vec_extract patterns

2013-05-05 Thread Uros Bizjak
Hello!

2013-05-05  Uros Bizjak  

* config/i386/sse.md (*vec_extract_0): Merge
from sse2_stored and *sse2_storeq_rex64 using SWI48 mode iterator.
Add m->r,x alternatives.
(*vec_extract_0 splitters): Merge V2DI and V4SI
splitters using SWI48x mode iterator.
(*vec_extract_v2di_0_sse): Rename from *sse2_storeq.  Disable for
TARGET_64BIT.  Add m->x alternative.
(*vec_extractv4si_mem): Rename from *vec_ext_v4si_mem.
Add o->x alternative.  Enable for TARGET_SSE.
(sse_storeq): Remove expander.
(*vec_extractv2di_1): Enable for TARGET_SSE. Split alternatives
with memory input operand.
(*vec_extractv2di_1 splitter): New.
(*vec_extractv4sf_mem): Rename from *vec_extract_v4sf_mem.
* config/i386/i386.md (ssevecmodelower): New mode attribute.

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

Uros.
Index: i386.md
===
--- i386.md (revision 198607)
+++ i386.md (working copy)
@@ -929,6 +929,8 @@
 ;; SSE vector mode corresponding to a scalar mode
 (define_mode_attr ssevecmode
   [(QI "V16QI") (HI "V8HI") (SI "V4SI") (DI "V2DI") (SF "V4SF") (DF "V2DF")])
+(define_mode_attr ssevecmodelower
+  [(QI "v16qi") (HI "v8hi") (SI "v4si") (DI "v2di") (SF "v4sf") (DF "v2df")])
 
 ;; Instruction suffix for REX 64bit operators.
 (define_mode_attr rex64suffix [(SI "") (DI "{q}")])
Index: sse.md
===
--- sse.md  (revision 198607)
+++ sse.md  (working copy)
@@ -4347,11 +4347,11 @@
(set_attr "prefix" "maybe_vex,*,*")
(set_attr "mode" "V4SF,*,*")])
 
-(define_insn_and_split "*vec_extract_v4sf_mem"
+(define_insn_and_split "*vec_extractv4sf_mem"
   [(set (match_operand:SF 0 "register_operand" "=x,*r,f")
-   (vec_select:SF
-(match_operand:V4SF 1 "memory_operand" "o,o,o")
-(parallel [(match_operand 2 "const_0_to_3_operand" "n,n,n")])))]
+   (vec_select:SF
+ (match_operand:V4SF 1 "memory_operand" "o,o,o")
+ (parallel [(match_operand 2 "const_0_to_3_operand" "n,n,n")])))]
   "TARGET_SSE"
   "#"
   "&& reload_completed"
@@ -7014,7 +7014,7 @@
(set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
 
-;; It must come before *vec_extractv2di_1_rex64 since it is preferred.
+;; It must come before *vec_extractv2di_1 since it is preferred.
 (define_insn "*sse4_1_pextrq"
   [(set (match_operand:DI 0 "nonimmediate_operand" "=rm")
(vec_select:DI
@@ -7357,99 +7357,85 @@
(set_attr "prefix" "maybe_vex,maybe_vex,orig,orig,vex")
(set_attr "mode" "TI,TI,V4SF,SF,SF")])
 
-(define_insn_and_split "sse2_stored"
-  [(set (match_operand:SI 0 "nonimmediate_operand" "=xm,r")
-   (vec_select:SI
- (match_operand:V4SI 1 "register_operand" "x,Yj")
+(define_insn "*vec_extract_0"
+  [(set (match_operand:SWI48 0 "nonimmediate_operand" "=x,m,r ,r")
+   (vec_select:SWI48
+ (match_operand: 1 "nonimmediate_operand" "xm,x,Yj,m")
  (parallel [(const_int 0)])))]
-  "TARGET_SSE"
-  "#"
-  "&& reload_completed
-   && (TARGET_INTER_UNIT_MOVES_FROM_VEC
-   || MEM_P (operands [0])
-   || !GENERAL_REGNO_P (true_regnum (operands [0])))"
-  [(set (match_dup 0) (match_dup 1))]
-  "operands[1] = gen_rtx_REG (SImode, REGNO (operands[1]));")
+  "TARGET_SSE && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+  "#")
 
-(define_insn_and_split "*vec_ext_v4si_mem"
-  [(set (match_operand:SI 0 "register_operand" "=r")
-   (vec_select:SI
- (match_operand:V4SI 1 "memory_operand" "o")
- (parallel [(match_operand 2 "const_0_to_3_operand")])))]
-  ""
-  "#"
-  "reload_completed"
-  [(const_int 0)]
-{
-  int i = INTVAL (operands[2]);
-
-  emit_move_insn (operands[0], adjust_address (operands[1], SImode, i*4));
-  DONE;
-})
-
-(define_expand "sse_storeq"
-  [(set (match_operand:DI 0 "nonimmediate_operand")
+(define_insn "*vec_extractv2di_0_sse"
+  [(set (match_operand:DI 0 "nonimmediate_operand" "=x,m")
(vec_select:DI
- (match_operand:V2DI 1 "register_operand")
+ (match_operand:V2DI 1 "nonimmediate_operand" "xm,x")
  (parallel [(const_int 0)])))]
-  "TARGET_SSE")
+  "TARGET_SSE && !TARGET_64BIT
+   && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+  "#")
 
-(define_insn "*sse2_storeq_rex64"
-  [(set (match_operand:DI 0 "nonimmediate_operand" "=xm,*r,r")
-   (vec_select:DI
- (match_operand:V2DI 1 "nonimmediate_operand" "x,Yj,o")
+(define_split
+  [(set (match_operand:SWI48x 0 "register_operand")
+   (vec_select:SWI48x
+ (match_operand: 1 "memory_operand")
  (parallel [(const_int 0)])))]
-  "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
-  "@
-   #
-   #
-   mov{q}\t{%1, %0|%0, %1}"
-  [(set_attr "type" "*,*,imov")
-   (set_attr "mode" "*,*,DI")])
+  "TARGET_SSE && reload_completed"
+  [(set (match_dup 0) (match_dup 1))]
+  "operands[1] = adjust_address (operands[1], mod

[PATCH,FORTRAN] Add libcaf prototype

2013-05-05 Thread David Edelsohn
libcaf produces warnings because it defines functions without
prototypes.  This patch adds prototypes.

Bootstrapped on powerpc-ibm-aix7.1.0.0.

Thanks, David


   * libcaf.h (_gfortran_caf_critical): Add a prototype.
   (_gfortran_caf_end_critical): Same.

Index: libcaf.h
===
--- libcaf.h(revision 198603)
+++ libcaf.h(working copy)
@@ -76,7 +76,10 @@

 /* FIXME: The CRITICAL functions should be removed;
the functionality is better represented using Coarray's lock feature.  */
+void _gfortran_caf_critical (void);
 void _gfortran_caf_critical (void)  { }
+
+void _gfortran_caf_end_critical (void);
 void _gfortran_caf_end_critical (void)  { }


Re: [patch, libgfortran] PR56743 Namelist bug with comment and no blank

2013-05-05 Thread Jerry DeLisle
On 05/05/2013 05:47 AM, Steve Kargl wrote:
> On Sat, May 04, 2013 at 10:25:19PM -0700, Jerry DeLisle wrote:
>> On 05/04/2013 06:30 PM, Steve Kargl wrote:
>>> On Sat, May 04, 2013 at 05:13:51PM -0700, Jerry DeLisle wrote:
  
CASE_SEPARATORS:/* Not a repeat count.  */
case EOF:
 +  case '!':
>>>
>>>   if (c == '!')
>>>  gfc_warning("GNU Fortran extension: accepting a possibly "
>>>  "corrupted namelist");
>>
>> --- SNIP ---
>>
>>> I would prefer that gfortran issues an error.
>>> Issuing a warning is acceptable.
>>> Patch as is not OK IMHO.
>>>
>>> PS: A vendor extension should be documented in the manual.
>>>
>>
>> I don't see much point in issuing a warning if we accept it.
> 
> Point 1.  If the standard requires a valid separator before !
>   then gfortran should complain about the nonconforming
>   namelist.  Silently violating the standard just seems
>   wrong to me.
> 
> Point 2. By issuing the warning, the user will be alerted to the
>  nonconforming namelist and may then be motivated to
>  fix the problem for portability.
> 
>>  I can just as
>> easily make it an error with something like "A value separator is required
>> before a namelist comment" and be done with trying to second guess whether
>> someone is using namelists right or not.
> 
> Issuing an error is my preference.  Issuing a warning is also
> acceptable.  Silently aceepting the code seems wrong.  Do we
> know what other compilers do?
> 

All,

Just to clarify, the issue is not a missing blank, its really a missing valid
separator which can be any one of ' ', ',', ';', '/', '\n', '\r' .

Jerry


Re: [patch, libgfortran] PR56743 Namelist bug with comment and no blank

2013-05-05 Thread Janne Blomqvist
On Sun, May 5, 2013 at 8:25 AM, Jerry DeLisle  wrote:
> I don't see much point in issuing a warning if we accept it.  I can just as
> easily make it an error with something like "A value separator is required
> before a namelist comment" and be done with trying to second guess whether
> someone is using namelists right or not.
>
> An error would be most consistent across all variable kinds.
>
> Any other opinions out there?

- I don't like the idea of printing a runtime warning either - users
are likely to ignore such things anyway.

- Different behavior with different -std= switches should be avoided
if possible - it just makes coding and testing more difficult than it
already is.

So my preference would be to generate an error, or if this is a common
extension in other compilers, accept it silently (and add a note about
it in the manual).



--
Janne Blomqvist


[Fortran-Dev] Update SIZE/SHAPE and extent handling

2013-05-05 Thread Tobias Burnus
This patch changes the setting of the extent field. TS29113 requires 
that extent is >= 0; before we used ubound directly, i.e. extent = 
ubound - lbound+1. Thus, the extent could become negative. Actually, 
TS29113 also permits negative extents: For assumed-size arrays.


Now since the extent is correctly set, LBOUND/UBOUND can be simplified - 
making the code more readable and speeding it up. Additionally, it will 
make it easier to shift the internal descriptor's lower_bound to 0 for 
nonallocatable/nonpointer variables.


Additionally, SHAPE/SIZE have to be converted to directly generated code 
- before they were implemented using library calls. One tricky part is 
that "SIZE(array, dim)" permits that "dim" is an optional, which means 
that one only knows at runtime whether the variable is present or not.


Build and regtested on x86-64-gnu-linux.
I intent to commit the patch soon. However, patch reviews, comments and 
remarks to the patch and to the Branch in general are welcome.


* * *

TODO:
- Changing the internal descriptor's lower_bound to 0 for 
nonallocatable/nonpointer variables - and removing the offset field from 
the descriptor. (Those changes are related.)

- Fixing the remaining regressions
- Support byte strides (partially handled but parts of the code still 
assume element-based strides)
- Fix other issues as they pop up - also by auditing the setting (and 
use) of elem_len, ubound/extent, stride, type, attribute, and lower_bound.


Tobias

PS: I still get the following 15 test-suite failures:

gfortran.dg/auto_char_dummy_array_1.f90
gfortran.dg/auto_char_len_3.f90
gfortran.dg/class_array_1.f03
gfortran.dg/class_array_2.f03
gfortran.dg/class_to_type_1.f03
gfortran.dg/class_to_type_2.f90
gfortran.dg/move_alloc_13.f90
gfortran.dg/mvbits_7.f90
gfortran.dg/mvbits_8.f90
gfortran.dg/proc_decl_23.f90
gfortran.dg/select_type_26.f03
gfortran.dg/select_type_27.f03
gfortran.dg/subref_array_pointer_2.f90
gfortran.dg/transfer_intrinsic_3.f90
gfortran.dg/unlimited_polymorphic_1.f03
2013-05-05  Tobias Burnus  

	* trans-array.c (gfc_conv_ss_startstride, set_loop_bounds): Handle
	GFC_ISYM_SHAPE in the scalarizer.
	(gfc_array_init_size, gfc_conv_expr_descriptor): Ensure that
	extent is never negative except for assumed size arrays.
	* trans-intrinsic.c (gfc_conv_intrinsic_bound): Optimizations
	of the bounds handling.
	(gfc_conv_intrinsic_size): Handle SIZE and SHAPE directly without
	calling the library.
	(gfc_conv_intrinsic_function, gfc_add_intrinsic_ss_code,
	gfc_walk_intrinsic_bound, gfc_is_intrinsic_libcall,
	gfc_walk_intrinsic_function): Handle SHAPE.

2013-05-05  Tobias Burnus  

	* gfortran.dg/assumed_rank_13.f90: New.
	* gfortran.dg/array_section_2.f90: Remove tree-dump check.
	* gfortran.dg/assign_10.f90: Update dump-times.
	* gfortran.dg/transpose_optimization_2.f90: Ditto.
	* gfortran.dg/coarray_12.f90: Update dump pattern.
	* gfortran.dg/coarray_30.f90: Ditto.
	* gfortran.dg/intrinsic_size_3.f90: Ditto.

diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 34421df..08f12aa 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -4012,6 +4012,7 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
 	case GFC_ISYM_UBOUND:
 	case GFC_ISYM_LCOBOUND:
 	case GFC_ISYM_UCOBOUND:
+	case GFC_ISYM_SHAPE:
 	case GFC_ISYM_THIS_IMAGE:
 	  loop->dimen = ss->dimen;
 	  goto done;
@@ -4062,11 +4063,13 @@ done:
 	/* Fall through to supply start and stride.  */
 	case GFC_ISYM_LBOUND:
 	case GFC_ISYM_UBOUND:
+	case GFC_ISYM_SHAPE:
 	  {
 		gfc_expr *arg;
 
 		/* This is the variant without DIM=...  */
-		gcc_assert (expr->value.function.actual->next->expr == NULL);
+		gcc_assert (expr->value.function.actual->next->expr == NULL
+			|| expr->value.function.isym->id == GFC_ISYM_SHAPE);
 
 		arg = expr->value.function.actual->expr;
 		if (arg->rank == -1)
@@ -4818,10 +4821,12 @@ set_loop_bounds (gfc_loopinfo *loop)
 	  {
 		gfc_expr *expr = loopspec[n]->info->expr;
 
-		/* The {l,u}bound of an assumed rank.  */
+		/* The {l,u}bound and shape of an assumed rank.  */
 		gcc_assert ((expr->value.function.isym->id == GFC_ISYM_LBOUND
-			 || expr->value.function.isym->id == GFC_ISYM_UBOUND)
-			 && expr->value.function.actual->next->expr == NULL
+			 || expr->value.function.isym->id == GFC_ISYM_UBOUND
+			 || expr->value.function.isym->id == GFC_ISYM_SHAPE)
+			 && (expr->value.function.actual->next->expr == NULL
+ || expr->value.function.isym->id == GFC_ISYM_SHAPE)
 			 && expr->value.function.actual->expr->rank == -1);
 
 		loop->to[n] = info->end[dim];
@@ -5153,16 +5158,22 @@ gfc_array_init_size (tree descriptor, gfc_typespec *ts,
   offset = fold_build2_loc (input_location, MINUS_EXPR,
 gfc_array_index_type, offset, tmp);
 
-  /* Set upper bound.  */
+  /* Set extent.  */
   gfc_init_se (&se, NULL);
   gcc_assert (ubound);
   gfc_conv_expr_type (&se, ubound, gfc_array_i

Re: [PATCH,FORTRAN] Add libcaf prototype

2013-05-05 Thread Tobias Burnus

David Edelsohn wrote:

libcaf produces warnings because it defines functions without
prototypes.  This patch adds prototypes.

Bootstrapped on powerpc-ibm-aix7.1.0.0.


OK - given that the removal of _gfortran_caf_critical takes longer than 
expected, it makes sense to add a prototype to silence the warning.


Tobias


* libcaf.h (_gfortran_caf_critical): Add a prototype.
(_gfortran_caf_end_critical): Same.

Index: libcaf.h
===
--- libcaf.h(revision 198603)
+++ libcaf.h(working copy)
@@ -76,7 +76,10 @@

  /* FIXME: The CRITICAL functions should be removed;
 the functionality is better represented using Coarray's lock feature.  */
+void _gfortran_caf_critical (void);
  void _gfortran_caf_critical (void)  { }
+
+void _gfortran_caf_end_critical (void);
  void _gfortran_caf_end_critical (void)  { }





Re: powerpc64le-linux support

2013-05-05 Thread Joseph S. Myers
On Sun, 5 May 2013, David Edelsohn wrote:

> The -mcall-* options are more about PPC eABI.

Where the options are about changing the function-calling ABI, I don't 
think they cause problems.  It's the way the options make spec handling 
different from other architectures that's problematic, and there are 
enough differences not covered by them that I doubt linking objects for 
one OS using a compiler built for another is actually going to work well.

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


[PATCH] Fix thinko in SLSR that caused x86 bootstrap failure

2013-05-05 Thread Bill Schmidt
When creating a phi-adjustment along an incoming edge, where the related
argument should use the "hidden basis" directly, I created a situation
where we double-count the subsequent adjustment based on the candidate's
index.  The candidate's index shouldn't be taken into account at all for
the edge adjustment; it will be handled in relation to the created phi
basis.  This patch fixes that thinko.

I disabled processing of conditional candidates (and associated tests)
on Friday night to allow x86 targets to bootstrap cleanly.  This patch
also reinstates the disabled code.

Bootstrapped and tested on powerpc-unknown-linux-gnu and
i686-pc-linux-gnu with no new regressions.  Ok for trunk?

Thanks,
Bill



gcc:

2013-05-05  Bill Schmidt  

* gimple-ssa-strength-reduction.c (slsr_process_phi): Re-enable.
(find_candidates_in_block): Re-enable slsr_process_phi.
(create_phi_basis): Fix double counting of candidate adjustment.

gcc/testsuite:

2013-05-05  Bill Schmidt  

* gcc.dg/tree-ssa/slsr-32.c: Re-enable.
* gcc.dg/tree-ssa/slsr-33.c: Likewise.
* gcc.dg/tree-ssa/slsr-34.c: Likewise.
* gcc.dg/tree-ssa/slsr-35.c: Likewise.
* gcc.dg/tree-ssa/slsr-36.c: Likewise.
* gcc.dg/tree-ssa/slsr-37.c: Likewise.
* gcc.dg/tree-ssa/slsr-38.c: Likewise.


Index: gcc/testsuite/gcc.dg/tree-ssa/slsr-32.c
===
--- gcc/testsuite/gcc.dg/tree-ssa/slsr-32.c (revision 198611)
+++ gcc/testsuite/gcc.dg/tree-ssa/slsr-32.c (working copy)
@@ -3,7 +3,6 @@
 
 /* { dg-do compile } */
 /* { dg-options "-O3 -fdump-tree-optimized" } */
-/* { dg-skip-if "" { *-*-* } } */
 
 int
 f (int s, int c, int i)
Index: gcc/testsuite/gcc.dg/tree-ssa/slsr-33.c
===
--- gcc/testsuite/gcc.dg/tree-ssa/slsr-33.c (revision 198611)
+++ gcc/testsuite/gcc.dg/tree-ssa/slsr-33.c (working copy)
@@ -3,7 +3,6 @@
 
 /* { dg-do compile } */
 /* { dg-options "-O3 -fdump-tree-optimized" } */
-/* { dg-skip-if "" { *-*-* } } */
 
 int
 f (int c, int i)
Index: gcc/testsuite/gcc.dg/tree-ssa/slsr-34.c
===
--- gcc/testsuite/gcc.dg/tree-ssa/slsr-34.c (revision 198611)
+++ gcc/testsuite/gcc.dg/tree-ssa/slsr-34.c (working copy)
@@ -3,7 +3,6 @@
 
 /* { dg-do compile } */
 /* { dg-options "-O3 -fdump-tree-optimized" } */
-/* { dg-skip-if "" { *-*-* } } */
 
 extern void
 g (void);
Index: gcc/testsuite/gcc.dg/tree-ssa/slsr-35.c
===
--- gcc/testsuite/gcc.dg/tree-ssa/slsr-35.c (revision 198611)
+++ gcc/testsuite/gcc.dg/tree-ssa/slsr-35.c (working copy)
@@ -4,7 +4,6 @@
 
 /* { dg-do compile } */
 /* { dg-options "-O3 -fdump-tree-optimized" } */
-/* { dg-skip-if "" { *-*-* } } */
 
 int
 f (int c, int i)
Index: gcc/testsuite/gcc.dg/tree-ssa/slsr-36.c
===
--- gcc/testsuite/gcc.dg/tree-ssa/slsr-36.c (revision 198611)
+++ gcc/testsuite/gcc.dg/tree-ssa/slsr-36.c (working copy)
@@ -4,7 +4,6 @@
 
 /* { dg-do compile } */
 /* { dg-options "-O3 -fdump-tree-optimized" } */
-/* { dg-skip-if "" { *-*-* } } */
 
 int
 f (int s, int c, int i)
Index: gcc/testsuite/gcc.dg/tree-ssa/slsr-37.c
===
--- gcc/testsuite/gcc.dg/tree-ssa/slsr-37.c (revision 198611)
+++ gcc/testsuite/gcc.dg/tree-ssa/slsr-37.c (working copy)
@@ -4,7 +4,6 @@
 
 /* { dg-do compile } */
 /* { dg-options "-O3 -fdump-tree-optimized" } */
-/* { dg-skip-if "" { *-*-* } } */
 
 int
 f (int s, int c, int i)
Index: gcc/testsuite/gcc.dg/tree-ssa/slsr-38.c
===
--- gcc/testsuite/gcc.dg/tree-ssa/slsr-38.c (revision 198611)
+++ gcc/testsuite/gcc.dg/tree-ssa/slsr-38.c (working copy)
@@ -4,7 +4,6 @@
 
 /* { dg-do compile } */
 /* { dg-options "-O3 -fdump-tree-optimized" } */
-/* { dg-skip-if "" { *-*-* } } */
 
 int
 f (int c, int i)
Index: gcc/gimple-ssa-strength-reduction.c
===
--- gcc/gimple-ssa-strength-reduction.c (revision 198611)
+++ gcc/gimple-ssa-strength-reduction.c (working copy)
@@ -657,9 +657,6 @@ add_cand_for_stmt (gimple gs, slsr_cand_t c)
   *slot = c;
 }
 
-// FORNOW: Disable conditional candidate processing until bootstrap
-// issue can be sorted out for i686-pc-linux-gnu.
-#if 0
 /* Given PHI which contains a phi statement, determine whether it
satisfies all the requirements of a phi candidate.  If so, create
a candidate.  Note that a CAND_PHI never has a basis itself, but
@@ -750,7 +747,6 @@ slsr_process_phi (gimple phi, bool speed)
   /* Add the candidate to the statement-candidate mapping.  */
   add_cand_for_stmt (phi, c);
 }
-#endif
 
 /* Look for the following pattern:
 
@@ -1523,12 +1519

Re: Can -mno-big-switch be removed from the PA port?

2013-05-05 Thread John David Anglin

On 14-Apr-13, at 7:37 AM, Steven Bosscher wrote:


On Tue, Apr 9, 2013 at 3:46 AM, John David Anglin wrote:

Seems to cause a reload problem:
Problem may be in not removing the continuation character "\" from  
various

macro definitions.


Right, ASM_OUTPUT_ADDR_VEC_ELT and ASM_OUTPUT_ADDR_DIFF_ELT had a
trailing '\' that I should have removed. And I did remove it from the
tree that I used to do a cross-build, but forgot to update the patch.
Oops.

Correct patch attached.



Committed the attached version after testing on hppa2.0w-hp-hpux11.11  
and

hppa64-hp-hpux11.11.

Dave
--
John David Anglin   dave.ang...@bell.net


2013-05-05  Steven Bosscher  
John David Anglin  

* config.gcc (hppa*-*-*): Remove MASK_BIG_SWITCH from CPU default.
* config/pa/pa.opt: Make mbig-switch a no-op.
* config/pa/pa.h (TARGET_DEFAULT): Remove MASK_BIG_SWITCH.
(CASE_VECTOR_MODE): Always return SImode.
(ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Remove code
for the !TARGET_BIG_SWITCH case.
* config/pa/pa-linux.h: Likewise.
* config/pa/pa-openbsd.h: Likewise.
* config/pa/pa-hpux.h: Define TARGET_DEFAULT to 0.
* config/pa/pa.md (short_jump): Remove define_insn.
(casesi): Remove code for the !TARGET_BIG_SWITCH case.
(casesi0): Remove define_insn.
(type): Remove btable_branch.
(pa_combine_type): Likewise.
(in_nullified_branch_delay): Likewise.
(in_call_delay): Likewise.
(define_delay): Likewise.
(define_insn_reservation "Z3"): Likewise.
(define_insn_reservation "Z4"): Likewise.
* config/pa/pa.c  (pa_reorg): Remove code for !TARGET_BIG_SWITCH.
(pa_adjust_insn_length): Remove adjustment for btable branches.
* doc/invoke.texi (HPPA Options): Delete documentation for mbig-switch
and mno-big-switch

Index: doc/invoke.texi
===
--- doc/invoke.texi (revision 198603)
+++ doc/invoke.texi (working copy)
@@ -618,11 +618,11 @@
 
 @emph{HPPA Options}
 @gccoptlist{-march=@var{architecture-type} @gol
--mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
+-mdisable-fpregs  -mdisable-indexing @gol
 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
 -mfixed-range=@var{register-range} @gol
 -mjump-in-delay -mlinker-opt -mlong-calls @gol
--mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
+-mlong-load-store  -mno-disable-fpregs @gol
 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
 -mno-jump-in-delay  -mno-long-load-store @gol
 -mno-portable-runtime  -mno-soft-float @gol
@@ -13510,12 +13510,6 @@
 @opindex mpa-risc-2-0
 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} 
respectively.
 
-@item -mbig-switch
-@opindex mbig-switch
-Generate code suitable for big switch tables.  Use this option only if
-the assembler/linker complain about out-of-range branches within a switch
-table.
-
 @item -mjump-in-delay
 @opindex mjump-in-delay
 Fill delay slots of function calls with unconditional jump instructions
Index: config.gcc
===
--- config.gcc  (revision 198603)
+++ config.gcc  (working copy)
@@ -3698,10 +3698,9 @@
;;
 
hppa*-*-*)
-   target_cpu_default2="MASK_BIG_SWITCH"
if test x$gas = xyes
then
-   
target_cpu_default2="${target_cpu_default2}|MASK_GAS|MASK_JUMP_IN_DELAY"
+   target_cpu_default2="MASK_GAS|MASK_JUMP_IN_DELAY"
fi
;;
 
Index: config/pa/pa.md
===
--- config/pa/pa.md (revision 198603)
+++ config/pa/pa.md (working copy)
@@ -123,7 +123,7 @@
 ;; type "binary" insns have two input operands (1,2) and one output (0)
 
 (define_attr "type"
-  
"move,unary,binary,shift,nullshift,compare,load,store,uncond_branch,btable_branch,branch,cbranch,fbranch,call,sibcall,dyncall,fpload,fpstore,fpalu,fpcc,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,multi,milli,sh_func_adrs,parallel_branch,fpstore_load,store_fpload"
+  
"move,unary,binary,shift,nullshift,compare,load,store,uncond_branch,branch,cbranch,fbranch,call,sibcall,dyncall,fpload,fpstore,fpalu,fpcc,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,multi,milli,sh_func_adrs,parallel_branch,fpstore_load,store_fpload"
   (const_string "binary"))
 
 (define_attr "pa_combine_type"
@@ -166,7 +166,7 @@
 ;; For conditional branches. Frame related instructions are not allowed
 ;; because they confuse the unwind support.
 (define_attr "in_branch_delay" "false,true"
-  (if_then_else (and (eq_attr "type" 
"!uncond_branch,btable_branch,branch,cbranch,fbranch,call,sibcall,dyncall,multi,milli,sh_func_adrs,parallel_branch")
+  (if_then_else (and (eq_attr "type" 
"!uncond_branch,branch,cbranch,fbranch,

Re: Can -mno-big-switch be removed from the PA port?

2013-05-05 Thread Steven Bosscher
On Sun, May 5, 2013 at 10:50 PM, John David Anglin wrote:
> Committed the attached version after testing on hppa2.0w-hp-hpux11.11 and
> hppa64-hp-hpux11.11.

Thanks for working on this!

Ciao!
Steven


[SH] PR 52933 - Fix some failures on trunk

2013-05-05 Thread Oleg Endo
Hi,

Some of the SH div0s integer sign comparison cases stopped working.  The
attached patch fixes that.

Tested on rev 198595 with
make -k check RUNTESTFLAGS="--target_board=sh-sim
\{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}"

and no new failures.
OK?

Cheers,
Oleg

gcc/ChangeLog:

PR target/52933
* config/sh/sh.md (*cmp_div0s_0, *cmp_div0s_1, *movsicc_div0s):
Add variations of these patterns.
Index: gcc/config/sh/sh.md
===
--- gcc/config/sh/sh.md	(revision 198595)
+++ gcc/config/sh/sh.md	(working copy)
@@ -866,6 +866,16 @@
 	(lshiftrt:SI (xor:SI (match_dup 1) (match_dup 2)) (const_int 31)))
(set (match_dup 0) (reg:SI T_REG))])
 
+(define_insn "*cmp_div0s_0"
+  [(set (reg:SI T_REG)
+	(eq:SI (lshiftrt:SI (match_operand:SI 0 "arith_reg_operand")
+			(const_int 31))
+	   (ge:SI (match_operand:SI 1 "arith_reg_operand")
+		  (const_int 0]
+  "TARGET_SH1"
+  "div0s	%0,%1"
+  [(set_attr "type" "arith")])
+
 (define_insn_and_split "*cmp_div0s_1"
   [(set (match_operand:SI 0 "arith_reg_dest" "")
 	(ge:SI (xor:SI (match_operand:SI 1 "arith_reg_operand" "")
@@ -896,6 +906,19 @@
 			  (const_int 0)))
(set (reg:SI T_REG) (xor:SI (reg:SI T_REG) (const_int 1)))])
 
+(define_insn_and_split "*cmp_div0s_1"
+  [(set (reg:SI T_REG)
+	(eq:SI (lshiftrt:SI (match_operand:SI 0 "arith_reg_operand")
+			(const_int 31))
+	   (lshiftrt:SI (match_operand:SI 1 "arith_reg_operand")
+			(const_int 31]
+  "TARGET_SH1"
+  "#"
+  "&& can_create_pseudo_p ()"
+  [(set (reg:SI T_REG) (lt:SI (xor:SI (match_dup 0) (match_dup 1))
+			  (const_int 0)))
+   (set (reg:SI T_REG) (xor:SI (reg:SI T_REG) (const_int 1)))])
+
 ;; -
 ;; SImode compare and branch
 ;; -
@@ -1069,6 +1092,27 @@
 		  (match_dup 4)
 		  (match_dup 3)))])
 
+(define_insn_and_split "*movsicc_div0s"
+  [(set (match_operand:SI 0 "arith_reg_dest")
+	(if_then_else:SI (eq (lshiftrt:SI
+(match_operand:SI 1 "arith_reg_operand")
+(const_int 31))
+			 (lshiftrt:SI
+(match_operand:SI 2 "arith_reg_operand")
+(const_int 31)))
+			 (match_operand:SI 3 "arith_reg_operand")
+			 (match_operand:SI 4 "general_movsrc_operand")))
+   (clobber (reg:SI T_REG))]
+   "TARGET_PRETEND_CMOVE"
+   "#"
+   "&& 1"
+  [(set (reg:SI T_REG) (lt:SI (xor:SI (match_dup 1) (match_dup 2))
+			  (const_int 0)))
+   (set (match_dup 0)
+	(if_then_else (ne (reg:SI T_REG) (const_int 0))
+		  (match_dup 4)
+		  (match_dup 3)))])
+
 ;; -
 ;; SImode unsigned integer comparisons
 ;; -


Re: [SH] PR 52933 - Fix some failures on trunk

2013-05-05 Thread Kaz Kojima
Oleg Endo  wrote:
> Some of the SH div0s integer sign comparison cases stopped working.  The
> attached patch fixes that.
> 
> Tested on rev 198595 with
> make -k check RUNTESTFLAGS="--target_board=sh-sim
> \{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}"
> 
> and no new failures.
> OK?

OK.

Regards,
kaz


Re: mips SNaN/QNaN is swapped

2013-05-05 Thread Ian Lance Taylor
Thomas Schwinge  writes:

>> libgcc/
>>  * fp-bit.c (unpack_d, pack_d): Properly preserve and restore a
>>  NaN's payload.
>>  * fp-bit.h [FLOAT] (QUIET_NAN): Correct value.

This is OK.

Thanks.

Ian


Re: [PATCH 1/9] Improve pointer hash function to include all bits

2013-05-05 Thread Ian Lance Taylor
On Sat, May 4, 2013 at 1:41 PM, David Edelsohn  wrote:

> 2013-05-04  David Edelsohn  
>   Peter Bergner  
>   Segher Boessenkool  
>   Jakub Jelinek  

This is OK (the actual ChangeLog entry was omitted).

Thanks.

Ian


Re: powerpc64le-linux support

2013-05-05 Thread Alan Modra
On Sun, May 05, 2013 at 04:09:30PM +0930, Alan Modra wrote:
>   * config/rs6000/sysv4.h (ENDIAN_SELECT): Define, extracted from
>   (ASM_SPEC): ..here.  Emit DEFAULT_ASM_ENDIAN too.
>   (DEFAULT_ASM_ENDIAN): Define.
>   (CC1_SPEC, LINK_TARGET_SPEC): Use ENDIAN_SELECT.
>   * config/rs6000/linux64.h (ASM_SPEC32): Remove endian options.
>   Update -K PIC clause from sysv4.h.
>   (ASM_SPEC_COMMON): Use ENDIAN_SELECT.
>   (LINK_OS_LINUX_EMUL32, LINK_OS_LINUX_EMUL64): Likewise.

I managed to get the powerpc64le gas default endian select wrong, and
missed some places that ought to be using ENDIAN_SELECT.  Committing
as obvious.

* config/rs6000/linux.h (DEFAULT_ASM_ENDIAN): Define.
(LINK_OS_LINUX_EMUL): Use ENDIAN_SELECT.
* config/rs6000/linux64.h (DEFAULT_ASM_ENDIAN): Define.
* config/rs6000/sysv4le.h (DEFAULT_ASM_ENDIAN): Define.
(LINK_TARGET_SPEC): Use ENDIAN_SELECT.
* config/rs6000/sysv4.h (DEFAULT_ASM_ENDIAN): Define as -mbig.

Index: gcc/config/rs6000/linux.h
===
--- gcc/config/rs6000/linux.h   (revision 198619)
+++ gcc/config/rs6000/linux.h   (working copy)
@@ -79,10 +79,17 @@
 #undef LINK_OS_DEFAULT_SPEC
 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
 
+#undef  DEFAULT_ASM_ENDIAN
 #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
-#define LINK_OS_LINUX_EMUL "%{!mbig: %{!mbig-endian: -m 
elf32lppclinux}}%{mbig|mbig-endian: -m elf32ppclinux}"
+#define DEFAULT_ASM_ENDIAN " -mlittle"
+#define LINK_OS_LINUX_EMUL ENDIAN_SELECT(" -m elf32ppclinux",  \
+" -m elf32lppclinux",  \
+" -m elf32lppclinux")
 #else
-#define LINK_OS_LINUX_EMUL "%{!mlittle: %{!mlittle-endian: -m 
elf32ppclinux}}%{mlittle|mlittle-endian: -m elf32lppclinux}"
+#define DEFAULT_ASM_ENDIAN " -mbig"
+#define LINK_OS_LINUX_EMUL ENDIAN_SELECT(" -m elf32ppclinux",  \
+" -m elf32lppclinux",  \
+" -m elf32ppclinux")
 #endif
 
 #undef LINK_OS_LINUX_SPEC
Index: gcc/config/rs6000/linux64.h
===
--- gcc/config/rs6000/linux64.h (revision 198619)
+++ gcc/config/rs6000/linux64.h (working copy)
@@ -366,7 +375,9 @@
 #define GNU_USER_DYNAMIC_LINKER64 \
   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
 
+#undef  DEFAULT_ASM_ENDIAN
 #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
+#define DEFAULT_ASM_ENDIAN " -mlittle"
 #define LINK_OS_LINUX_EMUL32 ENDIAN_SELECT(" -m elf32ppclinux",
\
   " -m elf32lppclinux",\
   " -m elf32lppclinux")
@@ -374,6 +385,7 @@
   " -m elf64lppc", \
   " -m elf64lppc")
 #else
+#define DEFAULT_ASM_ENDIAN " -mbig"
 #define LINK_OS_LINUX_EMUL32 ENDIAN_SELECT(" -m elf32ppclinux",
\
   " -m elf32lppclinux",\
   " -m elf32ppclinux")
Index: gcc/config/rs6000/sysv4le.h
===
--- gcc/config/rs6000/sysv4le.h (revision 198619)
+++ gcc/config/rs6000/sysv4le.h (working copy)
@@ -25,12 +25,12 @@
 #undef CC1_ENDIAN_DEFAULT_SPEC
 #defineCC1_ENDIAN_DEFAULT_SPEC "%(cc1_endian_little)"
 
+#undef DEFAULT_ASM_ENDIAN
+#defineDEFAULT_ASM_ENDIAN " -mlittle"
+
 #undef LINK_TARGET_SPEC
-#defineLINK_TARGET_SPEC "\
-%{mbig: --oformat elf32-powerpc } %{mbig-endian: --oformat elf32-powerpc } \
-%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
-%{mcall-linux: --oformat elf32-powerpc} \
-  "
+#defineLINK_TARGET_SPEC \
+  ENDIAN_SELECT(" --oformat elf32-powerpc", "", "")
 
 #undef MULTILIB_DEFAULTS
 #defineMULTILIB_DEFAULTS { "mlittle", "mcall-sysv" }
Index: gcc/config/rs6000/sysv4.h
===
--- gcc/config/rs6000/sysv4.h   (revision 198619)
+++ gcc/config/rs6000/sysv4.h   (working copy)
@@ -527,11 +533,7 @@
   "mcall-i960-old:"LITTLE_OPT ";"  \
   ":"  DEFAULT_OPT "}"
 
-#if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
-#define DEFAULT_ASM_ENDIAN " -mlittle"
-#else
 #define DEFAULT_ASM_ENDIAN " -mbig"
-#endif
 
 #undef ASM_SPEC
 #defineASM_SPEC "%(asm_cpu) \

-- 
Alan Modra
Australia Development Lab, IBM


Re: [PATCH] Use indentation in gtype.state to show nested structure

2013-05-05 Thread Laurynas Biveinis
> +2013-05-03  David Malcolm  
> +
> +   * gengtype-state.c: (indent_amount): New variable,
> +   (had_recent_newline): likewise
> +   (write_new_line): New function
> +   (write_any_indent): likewise
> +   (write_open_paren): likewise
> +   (write_close_paren): likewise
> +   (write_state_fileloc): Use the new functions above to write
> +   indentation into the gtype.state output file to visually represent
> +   the hierarchical structure of the list structures
> +   (write_state_fields): ditto
> +   (write_state_a_string): ditto
> +   (write_state_string_option): ditto
> +   (write_state_type_option): ditto
> +   (write_state_nested_option): ditto
> +   (write_state_option): ditto
> +   (write_state_options): ditto
> +   (write_state_lang_bitmap): ditto
> +   (write_state_version): ditto
> +   (write_state_scalar_type): ditto
> +   (write_state_string_type): ditto
> +   (write_state_undefined_type): ditto
> +   (write_state_struct_union_type): ditto
> +   (write_state_user_struct_type): ditto
> +   (write_state_lang_struct_type): ditto
> +   (write_state_param_struct_type): ditto
> +   (write_state_pointer_type): ditto
> +   (write_state_array_type): ditto
> +   (write_state_gc_used): ditto
> +   (write_state_type): ditto
> +   (write_state_pair): ditto
> +   (write_state_typedefs): ditto
> +   (write_state_structures): ditto
> +   (write_state_param_structs): ditto
> +   (write_state_variables): ditto
> +   (write_state_variables): ditto
> +   (write_state_files_list): ditto
> +   (write_state_languages): ditto
> +

The patch is OK with some minor formatting errors fixed:

> @@ -714,14 +778,15 @@ write_state_options (options_p opt)
>
>if (opt == NULL)
>  {
> -  fprintf (state_file, "nil ");
> +   write_any_indent (0);
> +   fprintf (state_file, "nil ");
>return;
>  }

Indentation error

> @@ -729,16 +794,17 @@ write_state_options (options_p opt)
>  static void
>  write_state_lang_bitmap (lang_bitmap bitmap)
>  {
> -  fprintf (state_file, "%d ", (int) bitmap);
> +   write_any_indent (0);
> +   fprintf (state_file, "%d ", (int) bitmap);
>  }

Likewise

> @@ -889,7 +971,10 @@ write_state_param_struct_type (type_p current)
>if (current->u.param_struct.param[i] != NULL)
> write_state_type (current->u.param_struct.param[i]);
>else
> +{
> +   write_any_indent (0);
> fprintf (state_file, "nil ");
> +}
>  }
>write_state_fileloc (¤t->u.param_struct.line);
>  }

Likewise

> @@ -1155,17 +1260,19 @@ write_state_files_list (void)
>cursrcrelpath = get_file_srcdir_relative_path (curfil);
>if (cursrcrelpath)
> {
> - fprintf (state_file, "(!srcfile %d ", get_lang_bitmap (curfil));
> + write_open_paren ("srcfile");
> +  fprintf (state_file, "%d ", get_lang_bitmap (curfil));
>   write_state_a_string (cursrcrelpath);
> }
>else

Likewise

--
Laurynas


Re: [PATCH] Fix array sizes created by Java FE (PR libgcj/57074)

2013-05-05 Thread Alan Modra
I'd really like to see this in, so that powerpc doesn't silently
generate wrong code.  Bootstrapped and regression tested
powerpc64-linux, with Jakub's java fixes applied.

* varasm.c (output_object_block): Use .org for each item in
section anchor block rather than padding.

Index: gcc/varasm.c
===
--- gcc/varasm.c(revision 198274)
+++ gcc/varasm.c(working copy)
@@ -7095,6 +7105,10 @@
   HOST_WIDE_INT offset;
   tree decl;
   rtx symbol;
+#if HAVE_GNU_AS
+  static int labelno;
+  char buf[30];
+#endif
 
   if (!block->objects)
 return;
@@ -7104,6 +7118,12 @@
   switch_to_section (block->sect);
   assemble_align (block->alignment);
 
+#if HAVE_GNU_AS
+  ASM_GENERATE_INTERNAL_LABEL (buf, "LANCB", labelno);
+  ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, buf);
+  ++labelno;
+#endif
+
   /* Define the values of all anchors relative to the current section
  position.  */
   FOR_EACH_VEC_SAFE_ELT (block->anchors, i, symbol)
@@ -7114,7 +7134,14 @@
   FOR_EACH_VEC_ELT (*block->objects, i, symbol)
 {
   /* Move to the object's offset, padding with zeros if necessary.  */
+#if HAVE_GNU_AS
+  fprintf (asm_out_file, "\t.org ");
+  assemble_name_raw (asm_out_file, buf);
+  fprintf (asm_out_file, "+" HOST_WIDE_INT_PRINT_DEC "\n",
+  SYMBOL_REF_BLOCK_OFFSET (symbol));
+#else
   assemble_zeros (SYMBOL_REF_BLOCK_OFFSET (symbol) - offset);
+#endif
   offset = SYMBOL_REF_BLOCK_OFFSET (symbol);
   if (CONSTANT_POOL_ADDRESS_P (symbol))
{

-- 
Alan Modra
Australia Development Lab, IBM