[Bug fortran/45636] Failed to fold simple Fortran string

2010-11-23 Thread danglin at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45636

John David Anglin danglin at gcc dot gnu.org changed:

   What|Removed |Added

 Status|RESOLVED|NEW
 CC||danglin at gcc dot gnu.org
 Resolution|FIXED   |

--- Comment #27 from John David Anglin danglin at gcc dot gnu.org 2010-11-23 
23:45:32 UTC ---
(In reply to comment #26)
 The mempcpy is not inlined with -Os.  Presumbably because that would increase
 the size of the resulting object.

Possibly, but based on Rainer's comment, the issue would appear to
affect targets with strict alignment.

Sorry for the mail spamage.  It was caused by a hardware failure at NRC.


[Bug fortran/45636] Failed to fold simple Fortran string

2010-11-23 Thread danglin at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45636

John David Anglin danglin at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #28 from John David Anglin danglin at gcc dot gnu.org 2010-11-24 
00:26:15 UTC ---
Sorry, I didn't intend to reopen.  The web interface seems to
unexpected change fields sometimes.


[Bug fortran/45636] Failed to fold simple Fortran string

2010-11-08 Thread sje at cup dot hp.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45636

Steve Ellcey sje at cup dot hp.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #26 from Steve Ellcey sje at cup dot hp.com 2010-11-08 16:08:19 
UTC ---
The mempcpy is not inlined with -Os.  Presumbably because that would increase
the size of the resulting object.


[Bug fortran/45636] Failed to fold simple Fortran string

2010-11-07 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45636

Tobias Burnus burnus at gcc dot gnu.org changed:

   What|Removed |Added

 CC|danglin at gcc dot gnu.org  |

--- Comment #24 from Tobias Burnus burnus at gcc dot gnu.org 2010-11-07 
07:46:24 UTC ---
remove Danglin to avoid mail spamage


[Bug fortran/45636] Failed to fold simple Fortran string

2010-11-07 Thread dave at hiauly1 dot hia.nrc.ca
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45636

--- Comment #25 from dave at hiauly1 dot hia.nrc.ca 2010-11-07 19:44:07 UTC ---
 The change was r166378 and if the test failures are the only reason to keep
 this bug report open then it we should be able to close it now.

Closing would be ok if there is a reason the call to mempcpy shouldn't
be eliminated.  On darwin, it was eliminated.

Dave


[Bug fortran/45636] Failed to fold simple Fortran string

2010-11-05 Thread sje at cup dot hp.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45636

Steve Ellcey sje at cup dot hp.com changed:

   What|Removed |Added

 CC||sje at cup dot hp.com

--- Comment #13 from Steve Ellcey sje at cup dot hp.com 2010-11-05 21:12:19 
UTC ---
I have moved gcc.c-torture/execute/pr45636.c to gcc.dg/torture/pr45636.c
and added a check for the mempcpy function so this should not fail on HP-UX or
Solaris which don't have a mempcpy function.

The change was r166378 and if the test failures are the only reason to keep
this bug report open then it we should be able to close it now.


[Bug fortran/45636] Failed to fold simple Fortran string

2010-10-28 Thread ro at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45636

Rainer Orth ro at gcc dot gnu.org changed:

   What|Removed |Added

 CC||ro at gcc dot gnu.org

--- Comment #12 from Rainer Orth ro at gcc dot gnu.org 2010-10-28 17:54:17 
UTC ---
gcc.c-torture/execute/pr45636.c also fails on Solaris 2/SPARC:

FAIL: gcc.c-torture/execute/pr45636.c compilation,  -Os 
UNRESOLVED: gcc.c-torture/execute/pr45636.c execution,  -Os 

Undefinedfirst referenced

 symbol  in file

mempcpy /var/tmp//ccJduPWN.o

ld: fatal: Symbol referencing errors. No output written to
/var/gcc/regression/trunk/10-gcc-gas/build/gcc/testsuite/gcc2/pr45636.x7

collect2: ld returned 1 exit status


[Bug fortran/45636] Failed to fold simple Fortran string

2010-10-17 Thread dave at hiauly1 dot hia.nrc.ca
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45636

--- Comment #11 from dave at hiauly1 dot hia.nrc.ca 2010-10-17 15:41:54 UTC ---
In addition, although gcc.c-torture/execute/pr45636.c doesn't fail on
hppa-unknown-linux-gnu, it does fail on hpux:

Executing on host: /test/gnu/gcc/objdir/gcc/xgcc -B/test/gnu/gcc/objdir/gcc/
/test/gnu/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/pr45636.c  -w  -O0   -lm 
 -o /test/gnu/gcc/objdir/gcc/testsuite/gcc/pr45636.x0(timeout = 300)
/usr/ccs/bin/ld: Unsatisfied symbols:
   mempcpy (first referenced in /var/tmp//ccT7jpSk.o) (code)

Looking at the hppa-linux .s, there are still many calls to various 'mem*'
functions.  I don't see any on x86.

Dave


[Bug fortran/45636] Failed to fold simple Fortran string

2010-10-16 Thread danglin at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45636

--- Comment #10 from John David Anglin danglin at gcc dot gnu.org 2010-10-16 
18:58:57 UTC ---
Created attachment 22064
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=22064
Tree dump.

gfortran.dg/pr45636.f90 fails on hppa-unknown-linux-gnu.  Tree dump
attached.


[Bug fortran/45636] Failed to fold simple Fortran string

2010-10-12 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45636

--- Comment #9 from Jakub Jelinek jakub at gcc dot gnu.org 2010-10-12 
22:01:07 UTC ---
Author: jakub
Date: Tue Oct 12 22:01:04 2010
New Revision: 165401

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=165401
Log:
PR fortran/45636
* tree-ssa-forwprop.c: Include expr.h.
(constant_pointer_difference, simplify_builtin_call): New functions.
(tree_ssa_forward_propagate_single_use_vars): Call
simplify_builtin_call on builtin calls.

* gcc.c-torture/execute/pr45636.c: New test.
* gfortran.dg/pr45636.f90: New test.

Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr45636.c
trunk/gcc/testsuite/gfortran.dg/pr45636.f90
Modified:
trunk/gcc/ChangeLog
trunk/gcc/Makefile.in
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-forwprop.c


[Bug fortran/45636] Failed to fold simple Fortran string

2010-09-27 Thread tkoenig at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45636

Thomas Koenig tkoenig at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2010.09.27 06:16:20
   date||
 CC||tkoenig at gcc dot gnu.org
 Ever Confirmed|0   |1
   Severity|normal  |enhancement

--- Comment #7 from Thomas Koenig tkoenig at gcc dot gnu.org 2010-09-27 
06:16:20 UTC ---
(In reply to comment #6)
 Created attachment 21891 [details]
 patch for comment#5
 
 This patch fixes the issue in comment #5 in the Fortran front end.

... but also causes regressions.  I'll investigate.

Confirmed, BTW.


[Bug fortran/45636] Failed to fold simple Fortran string

2010-09-10 Thread kargl at gcc dot gnu dot org


--- Comment #1 from kargl at gcc dot gnu dot org  2010-09-10 15:12 ---
I have a slightly different result with your code.

troutmask:sgk[212] gfc4x -c -O g.f90
g.f90: In function 'rcrdrd':
g.f90:1:0: internal compiler error: in build_int_cst_wide, at tree.c:1218
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.

If I replace the SAVE attribute by PARAMETER (which will most
likely cause the folding you want), everything compiles fine.
The ICE also goes away if I increase the length of DBL from
one to any larger value.

troutmask:sgk[219] gfc4x -v
Using built-in specs.
COLLECT_GCC=/home/sgk/work/4x/bin/gfortran
COLLECT_LTO_WRAPPER=/usr/home/sgk/work/4x/bin/../libexec/gcc/x86_64-unknown-freebsd9.0/4.6.0/lto-wrapper
Target: x86_64-unknown-freebsd9.0
Configured with: ../gcc4x/configure --prefix=/home/sgk/work/4x
--enable-languages=c,fortran --disable-libmudflap --disable-bootstrap
--with-quad=/home/sgk/work
Thread model: posix
gcc version 4.6.0 20100909 (experimental) (GCC) 


-- 

kargl at gcc dot gnu dot org changed:

   What|Removed |Added

   Keywords||ice-on-valid-code


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



[Bug fortran/45636] Failed to fold simple Fortran string

2010-09-10 Thread kargl at gcc dot gnu dot org


--- Comment #2 from kargl at gcc dot gnu dot org  2010-09-10 15:20 ---
The -fdump-tree-original for HJ's original code look like

rcrdrd (character(kind=1)[1:4]  restrict vtyp, integer(kind=4) _vtyp)
{
  static character(kind=1) dbl[1:1] = D;

  (MEM[(c_char * {ref-all})vtyp] = MEM[(c_char * {ref-all})dbl];, (void *)
vtyp;);
  __builtin_memset ((void *) vtyp + 1, 32, 3);
}

If I increase the length of DBL to 2, then the dump looks like

rcrdrd (character(kind=1)[1:4]  restrict vtyp, integer(kind=4) _vtyp)
{
  static character(kind=1) dbl[1:2] = D ;

  __builtin_memmove ((void *) vtyp, (void *) dbl, 2);
  __builtin_memset ((void *) vtyp + 2, 32, 2);
}


-- 


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



[Bug fortran/45636] Failed to fold simple Fortran string

2010-09-10 Thread hjl dot tools at gmail dot com


--- Comment #3 from hjl dot tools at gmail dot com  2010-09-10 15:32 ---
(In reply to comment #1)
 I have a slightly different result with your code.
 
 troutmask:sgk[212] gfc4x -c -O g.f90
 g.f90: In function 'rcrdrd':
 g.f90:1:0: internal compiler error: in build_int_cst_wide, at tree.c:1218
 Please submit a full bug report,
 with preprocessed source if appropriate.
 See http://gcc.gnu.org/bugs.html for instructions.
 


It is fixed by

http://gcc.gnu.org/ml/gcc-cvs/2010-09/msg00475.html


-- 


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



[Bug fortran/45636] Failed to fold simple Fortran string

2010-09-10 Thread kargl at gcc dot gnu dot org


--- Comment #4 from kargl at gcc dot gnu dot org  2010-09-10 15:34 ---
(In reply to comment #3)
 (In reply to comment #1)
  I have a slightly different result with your code.
  
  troutmask:sgk[212] gfc4x -c -O g.f90
  g.f90: In function 'rcrdrd':
  g.f90:1:0: internal compiler error: in build_int_cst_wide, at tree.c:1218
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See http://gcc.gnu.org/bugs.html for instructions.
  
 
 
 It is fixed by
 
 http://gcc.gnu.org/ml/gcc-cvs/2010-09/msg00475.html
 

HJ,

Thanks.  I updated by trunk right before your patch,
so I missed it my most recent build.


-- 


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



[Bug fortran/45636] Failed to fold simple Fortran string

2010-09-10 Thread jakub at gcc dot gnu dot org


--- Comment #5 from jakub at gcc dot gnu dot org  2010-09-10 15:47 ---
For arbitrary lengths (both of the constant string and of the padding) the
memmove (which will be optimized to memcpy as the source is read-only) + memset
is the best thing to do, replacing say
memmove (x, 900 bytes long string, 900);
memset (x + 900, ' ', 100);
would be very .rodata size unfriendly.
So, the question is, do we want to optimize this for very small sizes of both
(what sizes?  Should we call can_store_by_pieces to determine that from the
FE?)
in the FE by transforming that say
memmove (x, ABCDE, 5);
memset (x + 5, ' ', 3);
into
memcpy (x, ABCDE   , 8);
or should we do this generically in the middle-end, where we'd do this
transformation for such cases even for other languages?


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

   Keywords||ice-on-valid-code


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