[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-10-21 Thread nemet at gcc dot gnu dot org


--- Comment #20 from nemet at gcc dot gnu dot org  2008-10-21 17:48 ---
Subject: Bug 37669

Author: nemet
Date: Tue Oct 21 17:46:53 2008
New Revision: 141270

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=141270
Log:
PR middle-end/37669
* tree-ssa-ccp.c (ccp_fold_builtin): Only allow one argument to be
processed by get_maxval_strlen.

testsuite/
PR middle-end/37669
* gcc.c-torture/compile/pr37669-2.c: New test.

Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr37669-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-ccp.c


-- 


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-10-21 Thread nemet at gcc dot gnu dot org


--- Comment #21 from nemet at gcc dot gnu dot org  2008-10-21 17:48 ---
Fixed.


-- 

nemet at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-10-20 Thread rguenth at gcc dot gnu dot org


--- Comment #18 from rguenth at gcc dot gnu dot org  2008-10-20 09:40 
---
Heh, nobody ever will need more than 32 parameters!


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu dot
   ||org


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-10-20 Thread jakub at gcc dot gnu dot org


--- Comment #19 from jakub at gcc dot gnu dot org  2008-10-20 14:02 ---
As arg_mask is only 1, 2 or 4, the fix could be e.g. just break at the end of
if ((arg_mask  i)  1) body, or changing the for condition to i  nargs  i
= 31.  But if the former, we might as well turn arg_mask into arg_index, we
never set more than 1 bit in it, and not loop at all.
The loop made sense in 4.2 and earlier where we had to walk the tree chain to
get at the arguments, now we have an array, so all we need is verify we have
enough arguments (assert should be enough, otherwise it wouldn't be a builtin?)
and just call get_maxval_strlen on the right argument.


-- 


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-10-19 Thread nemet at gcc dot gnu dot org


--- Comment #16 from nemet at gcc dot gnu dot org  2008-10-20 03:54 ---
I'm seeing this with mips64octeon-linux-gnu as well.

I think the problem is that in

ccp_fold_builtin():
  2502memset (val, 0, sizeof (val)); 
  2503for (i = 0; i  nargs; i++) 
  2504  { 
  2505if ((arg_mask  i)  1) 

arg_mask is an int and in the testcase nargs is 35.  Therefore the result of
the shift can be undefined.  I will start testing a fix soon.


-- 


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-10-19 Thread nemet at gcc dot gnu dot org


--- Comment #17 from nemet at gcc dot gnu dot org  2008-10-20 04:21 ---
I'm testing a patch.


-- 

nemet at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |nemet at gcc dot gnu dot org
   |dot org |
 Status|REOPENED|ASSIGNED
   GCC host triplet|[EMAIL PROTECTED]   |


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-10-13 Thread dominiq at lps dot ens dot fr


--- Comment #15 from dominiq at lps dot ens dot fr  2008-10-13 09:00 ---
gcc.c-torture/compile/pr37669.c fails also on i686-apple-darwin9 in 32 and 64
bit modes (as far as I can tell, it never passed).


-- 


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-10-06 Thread pinskia at gcc dot gnu dot org


--- Comment #14 from pinskia at gcc dot gnu dot org  2008-10-07 02:06 
---
This still fails after the patch to fix PR 37535 on i386-darwin8.11.1.


-- 


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-10-05 Thread hjl dot tools at gmail dot com


--- Comment #13 from hjl dot tools at gmail dot com  2008-10-05 19:44 
---
ira-merge branch is OK for i586-pc-linux-gnu:

http://gcc.gnu.org/ml/gcc-testresults/2008-10/msg00316.html

It has this patch:

http://gcc.gnu.org/ml/gcc-patches/2008-09/msg01955.html


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

 CC||hjl dot tools at gmail dot
   ||com


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-10-04 Thread ubizjak at gmail dot com


--- Comment #12 from ubizjak at gmail dot com  2008-10-04 21:47 ---
(In reply to comment #10)
 Must be darwin specific then, can't reproduce on x86_64-linux and from quick
 skim of gcc-testresults nobody else that supplied test summary recently 
 managed
 to reproduced it.

i586-pc-linux-gnu:
http://gcc.gnu.org/ml/gcc-testresults/2008-10/msg00245.html

i686-apple-darwin9:
http://gcc.gnu.org/ml/gcc-testresults/2008-10/msg00105.html


-- 


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-09-30 Thread jakub at gcc dot gnu dot org


--- Comment #10 from jakub at gcc dot gnu dot org  2008-09-30 09:26 ---
Must be darwin specific then, can't reproduce on x86_64-linux and from quick
skim of gcc-testresults nobody else that supplied test summary recently managed
to reproduced it.


-- 


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-09-30 Thread pinskia at gcc dot gnu dot org


--- Comment #11 from pinskia at gcc dot gnu dot org  2008-09-30 16:26 
---
Must be darwin specific then, can't reproduce on x86_64-linux

Has anyone tried bootstrapping on i686-linux-gnu with PIC enabled lately?  This
might show the same issue.


-- 


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-09-29 Thread jakub at gcc dot gnu dot org


--- Comment #4 from jakub at gcc dot gnu dot org  2008-09-29 13:23 ---
Can't reproduce with current SVN, neither the reduced nor original testcase, on
x86_64, i?86, ppc and ppc64.


-- 


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-09-29 Thread pinskia at gcc dot gnu dot org


--- Comment #5 from pinskia at gcc dot gnu dot org  2008-09-29 21:10 ---
Hmm, maybe this was one of the miscompiling that is happening with IRA ...


-- 


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-09-29 Thread pinskia at gcc dot gnu dot org


--- Comment #6 from pinskia at gcc dot gnu dot org  2008-09-29 21:12 ---
It fails with GNU C (GCC) version 4.4.0 20080926 (experimental) [trunk
revision 140710] (i386-apple-darwin8.11.1)  But not with a stage1 compiler so
...
I am going to add this testcase so we don't get the wrong code regression
again.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

   Keywords||ra, wrong-code


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-09-29 Thread pinskia at gcc dot gnu dot org


--- Comment #7 from pinskia at gcc dot gnu dot org  2008-09-29 21:24 ---
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 GCC target triplet||i?86-*-* x86_64-*-*
 Resolution||FIXED


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-09-29 Thread pinskia at gcc dot gnu dot org


--- Comment #8 from pinskia at gcc dot gnu dot org  2008-09-29 21:25 ---
Subject: Bug 37669

Author: pinskia
Date: Mon Sep 29 21:23:52 2008
New Revision: 140765

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=140765
Log:
2008-09-29  Andrew Pinski  [EMAIL PROTECTED]

PR middle-end/37669
* gcc.c-torture/compile/pr37669.c: New test.


Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr37669.c
Modified:
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-09-29 Thread pinskia at gcc dot gnu dot org


--- Comment #9 from pinskia at gcc dot gnu dot org  2008-09-30 01:41 ---
Actually my reduced testcase still fails for me on the trunk as of 
Mon Sep 29 21:29:02 UTC 2008 (revision 140765)


Stage1's gcc is still fine.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-09-28 Thread pinskia at gcc dot gnu dot org


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu dot
   ||org
  Component|c   |middle-end
   Keywords||ice-on-valid-code
Summary|ice for legal code with -O2 |[4.4 Regression] ice for
   ||legal code with -O2
   Target Milestone|--- |4.4.0


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



[Bug middle-end/37669] [4.4 Regression] ice for legal code with -O2

2008-09-28 Thread pinskia at gcc dot gnu dot org


--- Comment #3 from pinskia at gcc dot gnu dot org  2008-09-28 19:29 ---
Reduced testcase:
typedef long unsigned int size_t;
extern __inline __attribute__ ((__always_inline__)) int __attribute__
((__nothrow__)) snprintf (char *__restrict __s, size_t __n, __const char
*__restrict __fmt, ...)  {
  return __builtin___snprintf_chk (__s, __n, 2 - 1,   
__builtin_object_size (__s, 2  1), __fmt, __builtin_va_arg_pack ());
}
int n1, n2, n3, n4, f5, f6;
char * BackgroundGetUniqueString(void)
{
  char s[256];
  const char *chmap =
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_;
  snprintf(s, sizeof(s),
%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c,
   chmap[(n1  0)  0x3f], chmap[(n1  6)  0x3f],
   chmap[(n1  12)  0x3f], chmap[(n1  18)  0x3f],
   chmap[(n1  24)  0x3f], chmap[(n1  28)  0x3f],
   chmap[(n2  0)  0x3f], chmap[(n2  6)  0x3f],
   chmap[(n2  12)  0x3f], chmap[(n2  18)  0x3f],
   chmap[(n2  24)  0x3f], chmap[(n2  28)  0x3f],
   chmap[(n3  0)  0x3f], chmap[(n3  6)  0x3f],
   chmap[(n3  12)  0x3f], chmap[(n3  18)  0x3f],
   chmap[(n3  24)  0x3f], chmap[(n3  28)  0x3f],
   chmap[(n4  0)  0x3f], chmap[(n4  6)  0x3f],
   chmap[(n4  12)  0x3f], chmap[(n4  18)  0x3f],
   chmap[(n4  24)  0x3f], chmap[(n4  28)  0x3f],
   chmap[(f5  12)  0x3f], chmap[(f5  18)  0x3f],
   chmap[(f5  24)  0x3f], chmap[(f5  28)  0x3f],
   chmap[(f6  0)  0x3f], chmap[(f6  6)  0x3f]
   );
  return __builtin_strdup(s);
}


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   GCC host triplet|suse-linux-x86_64   |
   Last reconfirmed|-00-00 00:00:00 |2008-09-28 19:29:35
   date||


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