[Bug ada/41854] New: Assert_Failure sinfo.adb:2362

2009-10-28 Thread rogermc at iinet dot net dot au
System:
 Model Name:Mac mini
  Model Identifier: Macmini1,1
  Processor Name:   Intel Core Duo
  Processor Speed:  1.66 GHz
  Number Of Processors: 1
  Total Number Of Cores:2
  L2 Cache: 2 MB
  Memory:   2 GB
  Bus Speed:667 MHz
  Boot ROM Version: MM11.0055.B08
  SMC Version (system): 1.3f4

Operating System:
Mac OSX 10.6.1

Host program:
GPS 4.0.2 (20061211) hosted on i386-apple-darwin9.1.0
GNAT 4.4.3 20091023 (prerelease) [gcc-4_4-branch revision 153489]

Command and result (from gps Messages window):
gnatmake -c -u -P/Ada\ Projects/AdaQuant/adaquant.gpr tools.adb -d 
gcc -c -g -O1 -funroll-loops -fPIC -gnatf -gnato -fstack-check -gnatE -g -gnata
-gnat05 -gnatwj -gnatwl -gnatwr -gnatwz -gnatye -gnatys -I- -gnatA /Ada
Projects/AdaQuant/Source/tools.adb
+===GNAT BUG DETECTED==+
| 4.4.3 20091023 (prerelease) [gcc-4_4-branch revision 153489]
(i686-apple-darwin9) |
| Assert_Failure sinfo.adb:2362|
| Error detected at tools.adb:7:3  |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.|
| Use a subject line meaningful to you and us to track the bug.|
| Include the entire contents of this bug box in the report.   |
| Include the exact gcc or gnatmake command that you entered.  |
| Also include sources listed below in gnatchop format |
| (concatenated together with no headers between files).   |
+==+

Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.

/Ada Projects/AdaQuant/Source/tools.adb
/Ada Projects/AdaQuant/Source/tools.ads
/Ada Projects/AdaQuant/Source/types.ads

compilation abandoned
gnatmake: "/Ada Projects/AdaQuant/Source/tools.adb" compilation error

process exited with status 4


-- 
   Summary: Assert_Failure sinfo.adb:2362
   Product: gcc
   Version: 4.4.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ada
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rogermc at iinet dot net dot au


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



[Bug ada/41854] Assert_Failure sinfo.adb:2362

2009-10-28 Thread rogermc at iinet dot net dot au


--- Comment #1 from rogermc at iinet dot net dot au  2009-10-28 07:15 
---
Created an attachment (id=18922)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18922&action=view)
Types.ads


-- 


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



[Bug ada/41854] Assert_Failure sinfo.adb:2362

2009-10-28 Thread rogermc at iinet dot net dot au


--- Comment #2 from rogermc at iinet dot net dot au  2009-10-28 07:16 
---
Created an attachment (id=18923)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18923&action=view)
tools.ads


-- 


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



[Bug ada/41854] Assert_Failure sinfo.adb:2362

2009-10-28 Thread rogermc at iinet dot net dot au


--- Comment #3 from rogermc at iinet dot net dot au  2009-10-28 07:23 
---
Created an attachment (id=18924)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18924&action=view)
tools.adb

The bug report occurred when I changed
  basisData : tBasisData(Positive 1..2);
to:
  basisData : tBasisData(Positive range 1..2);
after getting the error:
  a range is not a valid discriminant constraint
(I'm just a re-learner after many years of absence for Ada)


-- 


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



[Bug ada/41854] Assert_Failure sinfo.adb:2362

2009-10-28 Thread rogermc at iinet dot net dot au


--- Comment #4 from rogermc at iinet dot net dot au  2009-10-28 07:27 
---
Bug is repeatable.
Syntax check works OK.


-- 

rogermc at iinet dot net dot au changed:

   What|Removed |Added

Summary|Assert_Failure  |Assert_Failure
   |sinfo.adb:2362  |sinfo.adb:2362


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



[Bug ada/41854] Assert_Failure sinfo.adb:2362

2009-10-28 Thread rogermc at iinet dot net dot au


--- Comment #5 from rogermc at iinet dot net dot au  2009-10-28 07:39 
---
Of course, correct declaration is bug free: 
 basisData : tBasisData(2);


-- 


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



[Bug target/35714] x86 poor code with pmaddwd

2009-10-28 Thread ubizjak at gmail dot com


--- Comment #6 from ubizjak at gmail dot com  2009-10-28 09:36 ---
Original testcase is now also fixed in mainline, on x86_64 compiles to (-O2):

madd:
pmaddwd a(%rip), %xmm0
ret

madd_swapped:
pmaddwd a(%rip), %xmm0
ret

.section.rodata
.align 16
.type   a, @object
.size   a, 16
a:
.value  -22725
.value  -12873
.value  -22725
.value  -12873
.value  -22725
.value  -12873
.value  -22725
.value  -12873


-- 

ubizjak at gmail dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.5.0


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



[Bug libstdc++/40852] [parallel-mode] parallel sort run time increases ~10 fold when vector size gets over ~4*10^9

2009-10-28 Thread singler at gcc dot gnu dot org


--- Comment #23 from singler at gcc dot gnu dot org  2009-10-28 10:04 
---
Subject: Bug 40852

Author: singler
Date: Wed Oct 28 10:04:03 2009
New Revision: 153648

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153648
Log:
2009-10-28  Johannes Singler  

PR libstdc++/40852
* include/parallel/multiseq_selection.h
(multiseq_partition, multiseq_selection):  Avoid intermediate
values exceeding the integer type range for very large inputs.


Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/parallel/multiseq_selection.h


-- 


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



[Bug libstdc++/40852] [parallel-mode] parallel sort run time increases ~10 fold when vector size gets over ~4*10^9

2009-10-28 Thread singler at gcc dot gnu dot org


--- Comment #24 from singler at gcc dot gnu dot org  2009-10-28 10:04 
---
Subject: Bug 40852

Author: singler
Date: Wed Oct 28 10:04:35 2009
New Revision: 153649

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153649
Log:
2009-10-28  Johannes Singler  

PR libstdc++/40852
* include/parallel/multiseq_selection.h
(multiseq_partition, multiseq_selection):  Avoid intermediate
values exceeding the integer type range for very large inputs.


Modified:
branches/gcc-4_4-branch/libstdc++-v3/ChangeLog
branches/gcc-4_4-branch/libstdc++-v3/include/parallel/multiseq_selection.h


-- 


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



[Bug other/31043] duplicated data in .rodata / .rodata.cst sections.

2009-10-28 Thread ubizjak at gmail dot com


--- Comment #2 from ubizjak at gmail dot com  2009-10-28 10:06 ---
4.3.x and newer gcc says:

pr31043.c:3: warning: 'pi' initialized and declared 'extern'

So, if you don't want to be treated as a constant, write

double pi = M_PI;

and this will generate the code you are looking for:

foo:
movsd   pi(%rip), %xmm0
ret

pi:
.long   1413754136
.long   1074340347

As far as double copy when "double const pi = M_PI;" is used, tree optimizers
already propagate constant to return, as evident from optimized dump:

foo ()
{
:
  return 3.141592653589793115997963468544185161590576171875e+0;

}

And this constant is handled in different way than its shadow in the memory.


-- 


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



[Bug libstdc++/40852] [parallel-mode] parallel sort run time increases ~10 fold when vector size gets over ~4*10^9

2009-10-28 Thread singler at gcc dot gnu dot org


--- Comment #25 from singler at gcc dot gnu dot org  2009-10-28 10:11 
---
Closing this bug.


-- 

singler at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug fortran/41777] Wrong-code with POINTER-returning GENERIC function

2009-10-28 Thread burnus at gcc dot gnu dot org


--- Comment #8 from burnus at gcc dot gnu dot org  2009-10-28 10:17 ---
Created an attachment (id=18925)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18925&action=view)
Better patch

Better fix. I think there are more of such problems around, but I won't fix
them now :-)


-- 

burnus at gcc dot gnu dot org changed:

   What|Removed |Added

  Attachment #18851|0   |1
is obsolete||


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



[Bug target/40741] code size explosion for integer comparison

2009-10-28 Thread bonzini at gcc dot gnu dot org


--- Comment #6 from bonzini at gnu dot org  2009-10-28 10:17 ---
Subject: Bug 40741

Author: bonzini
Date: Wed Oct 28 10:17:29 2009
New Revision: 153650

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153650
Log:
2009-10-28  Paolo Bonzini  

PR rtl-optimization/40741
* config/arm/arm.c (thumb1_rtx_costs): IOR or XOR with
a small constant is cheap.
* config/arm/arm.md (andsi3, iorsi3): Try to place the result of
force_reg on the LHS.
(xorsi3): Likewise, and split the XOR if the constant is complex
and not in Thumb mode.

2009-10-28  Paolo Bonzini  

PR rtl-optimization/40741
* gcc.target/arm/thumb-branch1.c: New.

Added:
trunk/gcc/testsuite/gcc.target/arm/thumb-branch1.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/arm/arm.c
trunk/gcc/config/arm/arm.md
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug c++/41853] Internal compiler error

2009-10-28 Thread rguenth at gcc dot gnu dot org


--- Comment #3 from rguenth at gcc dot gnu dot org  2009-10-28 10:24 ---
Fixed in 4.3.0.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.3.0


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



[Bug lto/41767] assertion in tree-sra.c

2009-10-28 Thread rguenth at gcc dot gnu dot org


--- Comment #10 from rguenth at gcc dot gnu dot org  2009-10-28 10:25 
---
I will give the situation a more detailed look later (but yes, I believe this
is invalid input to LTO).  Let's defer a solution a bit.


-- 


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



[Bug target/39715] [4.5 Regression][cond-optab] extra sign extensions on Thumb

2009-10-28 Thread bonzini at gcc dot gnu dot org


--- Comment #5 from bonzini at gnu dot org  2009-10-28 10:27 ---
Subject: Bug 39715

Author: bonzini
Date: Wed Oct 28 10:27:15 2009
New Revision: 153651

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153651
Log:
2009-10-28  Paolo Bonzini  

PR rtl-optimization/39715
* combine.c (simplify_comparison): Use extensions to
widen comparisons.  Try an ANDing first.

testsuite:
2009-10-28  Paolo Bonzini  

PR rtl-optimization/39715
* gcc.target/arm/thumb-bitfld1.c: New.


Added:
trunk/gcc/testsuite/gcc.target/arm/thumb-bitfld1.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/combine.c
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug target/40648] misaligned store vectorizer patch introduced 10% runtime regression on Polyhedron test_fpu

2009-10-28 Thread ubizjak at gmail dot com


--- Comment #11 from ubizjak at gmail dot com  2009-10-28 10:33 ---
Author: revitale
Date: Tue Oct 27 11:46:07 2009
New Revision: 153590

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153590
Log:
Fix PR40648 -- Fix misaligned store vectorizer patch

Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
   
trunk/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c
trunk/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c
trunk/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c
   
trunk/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c
trunk/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c
trunk/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c
trunk/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c
trunk/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c
trunk/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c
trunk/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c
trunk/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
trunk/gcc/testsuite/gcc.dg/vect/slp-25.c
trunk/gcc/testsuite/gcc.dg/vect/vect-109.c
trunk/gcc/testsuite/gcc.dg/vect/vect-26.c
trunk/gcc/testsuite/gcc.dg/vect/vect-27.c
trunk/gcc/testsuite/gcc.dg/vect/vect-28.c
trunk/gcc/testsuite/gcc.dg/vect/vect-29.c
trunk/gcc/testsuite/gcc.dg/vect/vect-33.c
trunk/gcc/testsuite/gcc.dg/vect/vect-44.c
trunk/gcc/testsuite/gcc.dg/vect/vect-48.c
trunk/gcc/testsuite/gcc.dg/vect/vect-50.c
trunk/gcc/testsuite/gcc.dg/vect/vect-52.c
trunk/gcc/testsuite/gcc.dg/vect/vect-54.c
trunk/gcc/testsuite/gcc.dg/vect/vect-56.c
trunk/gcc/testsuite/gcc.dg/vect/vect-58.c
trunk/gcc/testsuite/gcc.dg/vect/vect-60.c
trunk/gcc/testsuite/gcc.dg/vect/vect-70.c
trunk/gcc/testsuite/gcc.dg/vect/vect-72.c
trunk/gcc/testsuite/gcc.dg/vect/vect-87.c
trunk/gcc/testsuite/gcc.dg/vect/vect-88.c
trunk/gcc/testsuite/gcc.dg/vect/vect-89.c
trunk/gcc/testsuite/gcc.dg/vect/vect-91.c
trunk/gcc/testsuite/gcc.dg/vect/vect-92.c
trunk/gcc/testsuite/gcc.dg/vect/vect-93.c
trunk/gcc/testsuite/gcc.dg/vect/vect-95.c
trunk/gcc/testsuite/gcc.dg/vect/vect-96.c
trunk/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c
trunk/gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c
trunk/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c
trunk/gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c
trunk/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-2.c
trunk/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-3.c
trunk/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-4.c
trunk/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-5.c
trunk/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-6.c
trunk/gcc/testsuite/gcc.target/powerpc/vsx-vectorize-7.c
trunk/gcc/testsuite/gfortran.dg/vect/vect-2.f90
trunk/gcc/testsuite/gfortran.dg/vect/vect-3.f90
trunk/gcc/testsuite/gfortran.dg/vect/vect-4.f90
trunk/gcc/testsuite/gfortran.dg/vect/vect-5.f90
trunk/gcc/tree-vect-data-refs.c


-- 


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



[Bug target/40648] misaligned store vectorizer patch introduced 10% runtime regression on Polyhedron test_fpu

2009-10-28 Thread ubizjak at gmail dot com


--- Comment #12 from ubizjak at gmail dot com  2009-10-28 10:36 ---
The patch fixed the regression, see test_fpu chart [1] between
2009-10-27 and 2009-10-28.

[1] http://gcc.opensuse.org/c++bench/polyhedron/polyhedron-summary.txt-2-0.html


-- 

ubizjak at gmail dot com changed:

   What|Removed |Added

URL||http://gcc.gnu.org/ml/gcc-
   ||patches/2009-
   ||10/msg01604.html
 Status|NEW |RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.5.0


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



[Bug fortran/41777] Wrong-code with POINTER-returning GENERIC function

2009-10-28 Thread burnus at gcc dot gnu dot org


--- Comment #9 from burnus at gcc dot gnu dot org  2009-10-28 10:38 ---
> +attr1 = gfc_expr_attr (target);

s/target/pointer/

I am now regtesting and will re-read and submit the patch afterwards.

(Writing patches in the early morning jet-lagged via a very slow internet
connection does not work, cf. comment 5. But writing - newly jet-lagged - a
patch without regtesting via a fast connection does not work either, cf.
above.)


-- 


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



[Bug driver/41179] Documentation for "-fno-toplevel-reorder" is confusing (and wrong)

2009-10-28 Thread davmac at davmac dot org


--- Comment #1 from davmac at davmac dot org  2009-10-28 10:41 ---
Urgh. By "paragraph above" I am of course referring to the same paragraph.
However, the basic point - that "enabled" seems to be used with two different
meanings - stands.


-- 


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



[Bug target/40741] code size explosion for integer comparison

2009-10-28 Thread bonzini at gnu dot org


--- Comment #7 from bonzini at gnu dot org  2009-10-28 10:43 ---
Fixed (patch had been approved a long time ago).


-- 

bonzini at gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug target/39715] [4.5 Regression][cond-optab] extra sign extensions on Thumb

2009-10-28 Thread bonzini at gnu dot org


--- Comment #6 from bonzini at gnu dot org  2009-10-28 10:44 ---
First testcase fixed, bootstrapping now the patch for the second.


-- 


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



[Bug libstdc++/40852] [parallel-mode] parallel sort run time increases ~10 fold when vector size gets over ~4*10^9

2009-10-28 Thread paolo dot carlini at oracle dot com


--- Comment #26 from paolo dot carlini at oracle dot com  2009-10-28 10:44 
---
Fixed for 4.4.3 and mainline.


-- 

paolo dot carlini at oracle dot com changed:

   What|Removed |Added

   Target Milestone|--- |4.4.3


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



[Bug middle-end/41855] New: ICE in refs_may_alias_p_1, at tree-ssa-alias.c:855

2009-10-28 Thread rguenth at gcc dot gnu dot org
t.f90
-
SUBROUTINE int_gen_ti_header_char( hdrbuf, hdrbufsize, itypesize, &
  DataHandle, Element, VarName, Data, code )
  CALL int_gen_ti_header_c ( hdrbuf, hdrbufsize, itypesize, 1, &
 DataHandle, DummyData, DummyCount, code )
END SUBROUTINE int_gen_ti_header_char

t.c
---
extern void *memcpy(void *dest, const void *src, __SIZE_TYPE__ n);
char *p;
int int_gen_ti_header_c_ (char * hdrbuf, int * hdrbufsize,
  int * itypesize, int * typesize,
  int * DataHandle, char * Data,
  int * Count, int * code)
{
  memcpy (typesize, p, sizeof(int)) ;
  memcpy (Data, p, *Count * *typesize) ;
}


nicely sort-of-invalid, int_gen_ti_header_c_ stores into a CONST_DECL.


-- 
   Summary: ICE in refs_may_alias_p_1, at tree-ssa-alias.c:855
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Keywords: lto
  Severity: normal
  Priority: P3
 Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rguenth at gcc dot gnu dot org


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



[Bug middle-end/41855] ICE in refs_may_alias_p_1, at tree-ssa-alias.c:855

2009-10-28 Thread rguenth at gcc dot gnu dot org


--- Comment #1 from rguenth at gcc dot gnu dot org  2009-10-28 10:47 ---
> ./gfortran -B. -r -nostdlib -O3 -flto t.c t.f90
In file included from t.c:2:0,
 from :0:
t.f90: In function 'int_gen_ti_header_char':
t.f90:1:0: internal compiler error: in refs_may_alias_p_1, at
tree-ssa-alias.c:855
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
lto-wrapper: ././gfortran returned 1 exit status
collect2: lto-wrapper returned 1 exit status


-- 


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



[Bug middle-end/41855] ICE in refs_may_alias_p_1, at tree-ssa-alias.c:855

2009-10-28 Thread rguenth at gcc dot gnu dot org


--- Comment #2 from rguenth at gcc dot gnu dot org  2009-10-28 11:01 ---
Actually the original testcase used bcopy which is mishandled.  I have a patch
for that.


-- 


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



[Bug other/31043] duplicated data in .rodata / .rodata.cst sections.

2009-10-28 Thread pluto at agmk dot net


--- Comment #3 from pluto at agmk dot net  2009-10-28 12:03 ---
(In reply to comment #2)
> 4.3.x and newer gcc says:
> 
> pr31043.c:3: warning: 'pi' initialized and declared 'extern'

so, lets get correct testcase:

#ifndef pi_hpp
#define pi_hpp
extern double const pi;
extern double foo();
#endif

#include "pi.hpp"
#include 
double const pi = M_PI;
double foo() { return pi; }

now, it compiles cleanly with `g++ -Wall -Wextra -O2 -S pi.cpp`

> So, if you don't want to be treated as a constant, write
> 
> double pi = M_PI;
> 
> and this will generate the code you are looking for:

but in this testcase i don't want to drop const.

> As far as double copy when "double const pi = M_PI;" is used, tree optimizers
> already propagate constant to return, as evident from optimized dump:
> 
> foo ()
> {
> :
>   return 3.141592653589793115997963468544185161590576171875e+0;
> 
> }
> 
> And this constant is handled in different way than its shadow in the memory.

could you explain why? they are identicial constants.
-fmerge-constants should do something with this.


-- 


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



[Bug middle-end/41812] [4.5 Regression] test 20071030-1.c fails execution on powerpc64

2009-10-28 Thread bonzini at gnu dot org


--- Comment #3 from bonzini at gnu dot org  2009-10-28 12:21 ---
The patch is wrong because the result of MD is used also to process notes,
while the live registers problem does not consider a register live if it is
only used in notes.  We have:

;; lr  in1 [1] 2 [2] 31 [31] 67 [ap] 113 [sfp] 154 180

   88 {r179:SF=float(r180:DI);clobber scratch;}
  REG_EQUAL: float(r155:DI)

Then because r155 is not live, it is not included in MD and a random definition
(0.0) is replaced in the REG_EQUAL note.

I'll revert the patch.


-- 


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



[Bug middle-end/41812] [4.5 Regression] test 20071030-1.c fails execution on powerpc64

2009-10-28 Thread bonzini at gcc dot gnu dot org


--- Comment #4 from bonzini at gnu dot org  2009-10-28 12:37 ---
Subject: Bug 41812

Author: bonzini
Date: Wed Oct 28 12:37:30 2009
New Revision: 153652

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153652
Log:
2009-10-28  Paolo Bonzini  

PR rtl-optimization/41812

Revert:
2009-06-27  Paolo Bonzini  

* df-problems.c (df_md_scratch): New.
(df_md_alloc, df_md_free): Allocate/free it.
(df_md_local_compute): Only include live registers in init.
(df_md_transfer_function): Prune the in-set computed by
the confluence function, and the gen-set too.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/df-problems.c


-- 


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



[Bug c++/41856] New: g++.dg/lookup/extern-c-redecl[3,4] .C scan-assembler fails on darwin

2009-10-28 Thread howarth at nitro dot med dot uc dot edu
Two of the new testcases introduced in r153552 fail on both
powerpc-apple-darwin9 and x86_64-apple-darwin10...

FAIL: g++.dg/lookup/extern-c-redecl3.C scan-assembler call[\\t ]+fork
FAIL: g++.dg/lookup/extern-c-redecl4.C scan-assembler call[\\t ]+_Z4forkv


-- 
   Summary: g++.dg/lookup/extern-c-redecl[3,4] .C scan-assembler
fails on darwin
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: howarth at nitro dot med dot uc dot edu
 GCC build triplet: *-apple-darwin*
  GCC host triplet: *-apple-darwin*
GCC target triplet: *-apple-darwin*


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



[Bug middle-end/41855] ICE in refs_may_alias_p_1, at tree-ssa-alias.c:855

2009-10-28 Thread rguenth at gcc dot gnu dot org


--- Comment #3 from rguenth at gcc dot gnu dot org  2009-10-28 13:28 ---
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED


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



[Bug middle-end/41855] ICE in refs_may_alias_p_1, at tree-ssa-alias.c:855

2009-10-28 Thread rguenth at gcc dot gnu dot org


--- Comment #4 from rguenth at gcc dot gnu dot org  2009-10-28 13:28 ---
Subject: Bug 41855

Author: rguenth
Date: Wed Oct 28 13:28:32 2009
New Revision: 153655

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153655
Log:
2009-10-28  Richard Guenther  

PR middle-end/41855
* tree-ssa-alias.c (refs_may_alias_p_1): Deal with CONST_DECLs
(ref_maybe_used_by_call_p_1): Fix bcopy handling.
(call_may_clobber_ref_p_1): Likewise.
* tree-ssa-structalias.c (find_func_aliases): Likewise.
* alias.c (nonoverlapping_memrefs_p): Deal with CONST_DECLs.

* gfortran.dg/lto/20091028-1_0.f90: New testcase.
* gfortran.dg/lto/20091028-1_1.c: Likewise.
* gfortran.dg/lto/20091028-2_0.f90: Likewise.
* gfortran.dg/lto/20091028-2_1.c: Likewise.

Added:
trunk/gcc/testsuite/gfortran.dg/lto/20091028-1_0.f90
trunk/gcc/testsuite/gfortran.dg/lto/20091028-1_1.c
trunk/gcc/testsuite/gfortran.dg/lto/20091028-2_0.f90
trunk/gcc/testsuite/gfortran.dg/lto/20091028-2_1.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/alias.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-alias.c
trunk/gcc/tree-ssa-structalias.c


-- 


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



[Bug lto/41726] Recursion prevention in gimple_get_alias_set should be revisited

2009-10-28 Thread rguenth at gcc dot gnu dot org


--- Comment #1 from rguenth at gcc dot gnu dot org  2009-10-28 13:53 ---
Was reverted with r153659.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED


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



[Bug c++/41856] g++.dg/lookup/extern-c-redecl[3,4] .C scan-assembler fails on darwin

2009-10-28 Thread jakub at gcc dot gnu dot org


--- Comment #1 from jakub at gcc dot gnu dot org  2009-10-28 14:00 ---
I guess it is going to fail on many more targets.
One issue is that only some targets have call insn called that way, it can have
many other names on other targets.  Even on ix86/x86_64 it could be tail called
and be it jmp fork instead of call fork.  The second issue is that some targets
put various prefixes before the symbol name, guess the most often used one is
just an extra _ prefix.
So, probably the test should be limited to ix86/x86_64, ensure it is not built
with optimizations and accept extra optional _ before symbol name.


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||dodji at gcc dot gnu dot org


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



[Bug middle-end/41812] [4.5 Regression] test 20071030-1.c fails execution on powerpc64

2009-10-28 Thread bonzini at gnu dot org


--- Comment #5 from bonzini at gnu dot org  2009-10-28 14:27 ---
fixed.


-- 

bonzini at gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug target/41762] internal compiler error when compiling xorg-server

2009-10-28 Thread jakub at gcc dot gnu dot org


--- Comment #12 from jakub at gcc dot gnu dot org  2009-10-28 14:39 ---
Subject: Bug 41762

Author: jakub
Date: Wed Oct 28 14:39:06 2009
New Revision: 153667

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153667
Log:
PR target/41762
* config/i386/i386.c (ix86_pic_register_p): Don't call
rtx_equal_for_cselib_p for VALUEs discarded as useless.

* gcc.dg/pr41762.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/pr41762.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386.c
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug target/41762] internal compiler error when compiling xorg-server

2009-10-28 Thread jakub at gcc dot gnu dot org


--- Comment #13 from jakub at gcc dot gnu dot org  2009-10-28 14:41 ---
Subject: Bug 41762

Author: jakub
Date: Wed Oct 28 14:41:24 2009
New Revision: 153668

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153668
Log:
PR target/41762
* config/i386/i386.c (ix86_pic_register_p): Don't call
rtx_equal_for_cselib_p for VALUEs discarded as useless.

* gcc.dg/pr41762.c: New test.

Added:
branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr41762.c
Modified:
branches/gcc-4_4-branch/gcc/ChangeLog
branches/gcc-4_4-branch/gcc/config/i386/i386.c
branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


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



[Bug debug/41801] [4.5 Regression] VTA: ICE in loc_cmp.

2009-10-28 Thread jakub at gcc dot gnu dot org


--- Comment #3 from jakub at gcc dot gnu dot org  2009-10-28 14:43 ---
Subject: Bug 41801

Author: jakub
Date: Wed Oct 28 14:43:04 2009
New Revision: 153669

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153669
Log:
PR debug/41801
* builtins.c (get_builtin_sync_mem): Expand loc in ptr_mode,
call convert_memory_address on addr.

* g++.dg/ext/sync-3.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/ext/sync-3.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/builtins.c
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug middle-end/41837] Using '-O -fipa-struct-reorg -fwhole-program -fprofile-generate' gives 'internal compiler error: Segmentation fault'

2009-10-28 Thread jakub at gcc dot gnu dot org


--- Comment #7 from jakub at gcc dot gnu dot org  2009-10-28 14:45 ---
Subject: Bug 41837

Author: jakub
Date: Wed Oct 28 14:45:03 2009
New Revision: 153670

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153670
Log:
PR middle-end/41837
* ipa-struct-reorg.c (find_field_in_struct_1): Return NULL if
fields don't have DECL_NAME.

* gcc.dg/pr41837.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/pr41837.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-struct-reorg.c
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug lto/41839] ICE with lto and incomplete types

2009-10-28 Thread rguenth at gcc dot gnu dot org


--- Comment #3 from rguenth at gcc dot gnu dot org  2009-10-28 14:48 ---
Subject: Bug 41839

Author: rguenth
Date: Wed Oct 28 14:48:34 2009
New Revision: 153671

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153671
Log:
2009-10-28  Richard Guenther  

PR lto/41808
PR lto/41839
* tree-ssa.c (useless_type_conversion_p): Do not treat
conversions to pointers to incomplete types as useless.
* gimple.c (gimple_types_compatible_p): Compare struct tags,
not typedef names.

* gcc.dg/lto/20091027-1_0.c: New testcase.
* gcc.dg/lto/20091027-1_1.c: Likewise.
* g++.dg/lto/20091026-1_0.C: Likewise.
* g++.dg/lto/20091026-1_1.C: Likewise.
* g++.dg/lto/20091026-1_a.h: Likewise.

Added:
trunk/gcc/testsuite/g++.dg/lto/20091026-1_0.C
trunk/gcc/testsuite/g++.dg/lto/20091026-1_1.C
trunk/gcc/testsuite/g++.dg/lto/20091026-1_a.h
trunk/gcc/testsuite/gcc.dg/lto/20091027-1_0.c
trunk/gcc/testsuite/gcc.dg/lto/20091027-1_1.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimple.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa.c


-- 


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



[Bug lto/41808] error: non-trivial conversion at assignment

2009-10-28 Thread rguenth at gcc dot gnu dot org


--- Comment #6 from rguenth at gcc dot gnu dot org  2009-10-28 14:48 ---
Subject: Bug 41808

Author: rguenth
Date: Wed Oct 28 14:48:34 2009
New Revision: 153671

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153671
Log:
2009-10-28  Richard Guenther  

PR lto/41808
PR lto/41839
* tree-ssa.c (useless_type_conversion_p): Do not treat
conversions to pointers to incomplete types as useless.
* gimple.c (gimple_types_compatible_p): Compare struct tags,
not typedef names.

* gcc.dg/lto/20091027-1_0.c: New testcase.
* gcc.dg/lto/20091027-1_1.c: Likewise.
* g++.dg/lto/20091026-1_0.C: Likewise.
* g++.dg/lto/20091026-1_1.C: Likewise.
* g++.dg/lto/20091026-1_a.h: Likewise.

Added:
trunk/gcc/testsuite/g++.dg/lto/20091026-1_0.C
trunk/gcc/testsuite/g++.dg/lto/20091026-1_1.C
trunk/gcc/testsuite/g++.dg/lto/20091026-1_a.h
trunk/gcc/testsuite/gcc.dg/lto/20091027-1_0.c
trunk/gcc/testsuite/gcc.dg/lto/20091027-1_1.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimple.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa.c


-- 


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



[Bug lto/41839] ICE with lto and incomplete types

2009-10-28 Thread rguenth at gcc dot gnu dot org


--- Comment #4 from rguenth at gcc dot gnu dot org  2009-10-28 14:49 ---
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.5.0


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



[Bug lto/41808] error: non-trivial conversion at assignment

2009-10-28 Thread rguenth at gcc dot gnu dot org


--- Comment #7 from rguenth at gcc dot gnu dot org  2009-10-28 14:49 ---
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.5.0


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



[Bug fortran/41777] Wrong-code with POINTER-returning GENERIC function

2009-10-28 Thread burnus at gcc dot gnu dot org


--- Comment #10 from burnus at gcc dot gnu dot org  2009-10-28 15:03 ---
Created an attachment (id=18926)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18926&action=view)
New, non-reduced test case

Patch in comment 8 + fix in comment 9 regtests and fixes:
a) The fully reduced test case of comment 4
b) The partially reduced test case of comment 1

It does not fix the attached test case, which is a slightly modified version of
comment 1 - and which still needs FoX to be installed and input.xml of
attachment 18846 of PR 41772. The loc lines show:

 loc thisnode:   6945920
 loc item:   140736865394032

And the second one is clearly wrong. If one does not nest the arguments, but
saves "getElementsByTagname" as "np" and uses it in turn for "item()",
everything works as expected.

(Needless to say that the full program of comment 0 still does not work.)


-- 


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



[Bug c++/41856] g++.dg/lookup/extern-c-redecl[3,4] .C scan-assembler fails on darwin

2009-10-28 Thread dodji at gcc dot gnu dot org


--- Comment #2 from dodji at gcc dot gnu dot org  2009-10-28 15:38 ---
Yes, I'll limit the test to ix86/x86_64. Patch coming soon.


-- 

dodji at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |dodji at gcc dot gnu dot org
   |dot org |
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-10-28 15:38:45
   date||


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



[Bug c++/38699] [4.3/4.4/4.5 regression] ICE using offsetof with pointer and array accesses

2009-10-28 Thread dodji at redhat dot com


--- Comment #10 from dodji at gcc dot gnu dot org  2009-10-28 15:42 ---
Subject: Re:  [4.3/4.4/4.5 regression] ICE using offsetof
with pointer and array accesses

I am testing the patch below.

I am not sure the approach is the right one though. Comments welcome.

diff --git a/gcc/c-common.c b/gcc/c-common.c
index 8a6d15b..54e551f 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -8341,6 +8341,32 @@ fold_offsetof_1 (tree expr, tree stop_ref)

 case NOP_EXPR:
 case INDIRECT_REF:
+  if (TREE_CODE (expr) == INDIRECT_REF)
+   {
+ tree r = TREE_OPERAND (expr, 0);
+
+ if ((TREE_CODE (r) == NON_LVALUE_EXPR
+  && TREE_CODE (TREE_TYPE (r)) == POINTER_TYPE)
+ ||
+ (TREE_CODE (r) == POINTER_PLUS_EXPR))
+   {
+ /* We are trying something like:
+struct A
+{
+  char *p;
+};
+void f ()
+{
+  __builtin_offsetof(struct A, p[1]);
+}
+But the C spec says that if t is of type A, then
+ &(t.p[1])" should evaluate to a constant address.
+ And &(t.p[1]) does not evaluate to a constant address here.
+*/
+ error ("cannot apply % to a non constant address");
+ return error_mark_node;
+   }
+   }
   base = fold_offsetof_1 (TREE_OPERAND (expr, 0), stop_ref);
   gcc_assert (base == error_mark_node || base == size_zero_node);
   return base;
@@ -8361,6 +8387,16 @@ fold_offsetof_1 (tree expr, tree stop_ref)
size_int (tree_low_cst (DECL_FIELD_BIT_OFFSET (t),
1)
  / BITS_PER_UNIT));
+  /* Check if we the offset goes beyond the bound of the struct.  */
+  if (int_cst_value (off)
+ >= (int_cst_value (TYPE_SIZE (TREE_TYPE (TREE_OPERAND (expr, 0
+ / BITS_PER_UNIT))
+   {
+ error_at (EXPR_LOCATION (t),
+   "expression %qE denotes an offset greater than size of
%qT",
+   t, TREE_TYPE (TREE_OPERAND (expr, 0)));
+ return error_mark_node;
+   }
   break;

 case ARRAY_REF:
@@ -8376,6 +8412,17 @@ fold_offsetof_1 (tree expr, tree stop_ref)
}
   t = convert (sizetype, t);
   off = size_binop (MULT_EXPR, TYPE_SIZE_UNIT (TREE_TYPE (expr)), t);
+
+  /* Check if we the indice of the array goes beyond the bound.  */
+  if (int_cst_value (off)
+ >= (int_cst_value (TYPE_SIZE (TREE_TYPE (TREE_OPERAND (expr, 0
+ / BITS_PER_UNIT))
+   {
+ error_at (EXPR_LOCATION (expr),
+   "indice %ld denotes an offset greater than size of %qT",
+   int_cst_value (t), TREE_TYPE (TREE_OPERAND (expr, 0)));
+ return error_mark_node;
+   }
   break;

 case COMPOUND_EXPR:


-- 


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



[Bug fortran/41777] Wrong-code with POINTER-returning GENERIC function

2009-10-28 Thread burnus at gcc dot gnu dot org


--- Comment #11 from burnus at gcc dot gnu dot org  2009-10-28 15:47 ---
Related problem:
  print *, loc(f2(a)) ! OK
  print *, loc(f (a)) ! Error "must be a variable"
The second line uses a generic function with "f2" being the specific one.

The problem is that gfc_check_loc calls check_variable, which checks whether
function name = result name. I think this check is bogus. I think the purpose
is to allow:
  function_name = value   ! in "function function_name" !
but for
  value = function_name(bar)  ! or LOC(function_name(bar))
it does not matter whether sym == sym->result.

On the other hand, if one is outside of "function function_name"
  func(function_name)
is something different (= function and not result) and there it does not matter
whether sym == sym->result or not.

For the the example above, the patch below fixes it, but see caveat above.

Index: check.c
===
--- check.c (revision 153645)
+++ check.c (working copy)
@@ -288,7 +288,10 @@ variable_check (gfc_expr *e, int n)
   if ((e->expr_type == EXPR_VARIABLE
&& e->symtree->n.sym->attr.flavor != FL_PARAMETER)
   || (e->expr_type == EXPR_FUNCTION
- && e->symtree->n.sym->result == e->symtree->n.sym))
+ && ((!e->value.function.esym
+  && e->value.function.esym->result == e->value.function.esym)
+ || (e->value.function.esym
+ && e->symtree->n.sym->result == e->symtree->n.sym
 return SUCCESS;

   if (e->expr_type == EXPR_VARIABLE


-- 


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



[Bug c++/38699] [4.3/4.4/4.5 regression] ICE using offsetof with pointer and array accesses

2009-10-28 Thread dodji at gcc dot gnu dot org


-- 

dodji at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |dodji at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-01-02 20:06:49 |2009-10-28 15:58:51
   date||


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



[Bug libstdc++/41530] [c++0x] Cannot move-construct std::tuple from a different type of std::tuple

2009-10-28 Thread cfairles at gcc dot gnu dot org


--- Comment #7 from cfairles at gcc dot gnu dot org  2009-10-28 16:23 
---
Should be marked as fixed no?


-- 


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



[Bug libstdc++/41530] [c++0x] Cannot move-construct std::tuple from a different type of std::tuple

2009-10-28 Thread paolo dot carlini at oracle dot com


--- Comment #8 from paolo dot carlini at oracle dot com  2009-10-28 16:25 
---
Do we want it for 4.4.3 too or not? If you see issues open after commits to
mainline, normally it's because of that...


-- 


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



[Bug fortran/41777] Wrong-code with POINTER-returning GENERIC function

2009-10-28 Thread dominiq at lps dot ens dot fr


--- Comment #12 from dominiq at lps dot ens dot fr  2009-10-28 16:27 ---
> + && ((!e->value.function.esym

is the ! at the right place? If e->value.function.esym == 0, would not
e->value.function.esym->result == e->value.function.esym
gives a bus error/segmentation fault?


-- 


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



[Bug target/39715] [4.5 Regression][cond-optab] extra sign extensions on Thumb

2009-10-28 Thread bonzini at gcc dot gnu dot org


--- Comment #7 from bonzini at gnu dot org  2009-10-28 16:44 ---
Subject: Bug 39715

Author: bonzini
Date: Wed Oct 28 16:44:08 2009
New Revision: 153678

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153678
Log:
2009-10-28  Paolo Bonzini  

PR rtl-optimization/39715
* config/arm/arm.md (cstoresi4): Use gen_cstoresi_ltu_thumb1.
(gen_cstoresi_ltu_thumb1): New splitter.

2009-10-28  Paolo Bonzini  

PR rtl-optimization/39715
* gcc.target/arm/thumb-ltu.c: New.


Added:
trunk/gcc/testsuite/gcc.target/arm/thumb-ltu.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/arm/arm.md
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug target/39715] [4.5 Regression][cond-optab] extra sign extensions on Thumb

2009-10-28 Thread bonzini at gnu dot org


--- Comment #8 from bonzini at gnu dot org  2009-10-28 16:47 ---
patch committed


-- 

bonzini at gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug debug/41801] [4.5 Regression] VTA: ICE in loc_cmp.

2009-10-28 Thread jakub at gcc dot gnu dot org


--- Comment #4 from jakub at gcc dot gnu dot org  2009-10-28 18:02 ---
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug target/41762] internal compiler error when compiling xorg-server

2009-10-28 Thread jakub at gcc dot gnu dot org


--- Comment #14 from jakub at gcc dot gnu dot org  2009-10-28 18:02 ---
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug middle-end/41837] Using '-O -fipa-struct-reorg -fwhole-program -fprofile-generate' gives 'internal compiler error: Segmentation fault'

2009-10-28 Thread jakub at gcc dot gnu dot org


--- Comment #8 from jakub at gcc dot gnu dot org  2009-10-28 18:03 ---
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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



[Bug tree-optimization/41857] New: Loop optimizer breaks __ea pointers with -mea64

2009-10-28 Thread uweigand at gcc dot gnu dot org
The following test case

__ea char *strchr_ea (__ea const char *s, int c);
__ea char *foo (__ea char *s)
{
  __ea char *ret = s;
  int i;

  for (i = 0; i < 3; i++)
ret = strchr_ea (ret, s[i]);

  return ret;
}

results in an ICE when compiled with -O -mea64.

The reason is that the loop optimizers use an induction variable
of type "long long int" to represent s+i, instead of using the
appropriate pointer type.

This causes rewrite_use_address to call create_mem_ref with an
affine expression none of whose subexpressions is of pointer type.
Therefore, the induction variable is assigned as the "index" of
a TARGET_MEM_REF, which means it gets converted to sizetype.

As sizetype is smaller than the __ea pointer type in the -ea64 case,
this means that value would be truncated.  This is later caught by
an assertion in convert_memory_address, which causes the ICE.

Note that use of an integral induction variable was introduced as
part of the fix to PR tree-optimization/27865:
http://gcc.gnu.org/ml/gcc-patches/2006-08/msg00198.html

It seems to me it would be preferable to keep using pointer variables
where possible, even on platforms where sizetype is the same size as
pointers, in order to properly identify address base registers where
this makes a performance difference.


-- 
   Summary: Loop optimizer breaks __ea pointers with -mea64
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
AssignedTo: uweigand at gcc dot gnu dot org
ReportedBy: uweigand at gcc dot gnu dot org
GCC target triplet: spu-unknown-elf


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



[Bug c++/41856] g++.dg/lookup/extern-c-redecl[3,4] .C scan-assembler fails on darwin

2009-10-28 Thread dodji at seketeli dot org


--- Comment #3 from dodji at seketeli dot org  2009-10-28 20:53 ---
Subject: Re:  g++.dg/lookup/extern-c-redecl[3,4] .C
scan-assembler fails on darwin

Does this patch qualify as obvious ?

/bin/bash: call : commande introuvable
diff --git a/gcc/testsuite/g++.dg/lookup/extern-c-redecl3.C
b/gcc/testsuite/g++.dg/lookup/extern-c-redecl3.C
index 00ff4a9..3f2fee2 100644
--- a/gcc/testsuite/g++.dg/lookup/extern-c-redecl3.C
+++ b/gcc/testsuite/g++.dg/lookup/extern-c-redecl3.C
@@ -1,8 +1,9 @@
 // Contributed by Dodji Seketeli 
 // Origin: PR c++/41020
+// { dg-options "-O0" }
 // { dg-do compile }
-// { dg-final { scan-assembler-not "call\[\t \]+_Z4forkv" } }
-// { dg-final { scan-assembler "call\[\t \]+fork" } }
+// { dg-final { scan-assembler-not "call\[\t \]+_?_Z4forkv" { target i?86-*-*
x86_64-*-* } } }
+// { dg-final { scan-assembler "call\[\t \]+_?fork" { target i?86-*-*
x86_64-*-* } } }

 extern "C" int fork (void);

diff --git a/gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C
b/gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C
index 9dfa54d..bbe625e 100644
--- a/gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C
+++ b/gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C
@@ -1,10 +1,9 @@
 // Contributed by Dodji Seketeli 
 // Origin: PR c++/41020

-// Avoid the "-ansi -pedantic" option
-// { dg-options "" }
+// { dg-options "-O0" }
 // { dg-do compile }
-// { dg-final { scan-assembler "call\[\t \]+_Z4forkv" } }
+// { dg-final { scan-assembler "call\[\t \]+_?_Z4forkv" { target i?86-*-*
x86_64-*-* } } }

 class frok
 {


-- 


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



[Bug lto/41764] Bogus errors from gold with linker-plugin

2009-10-28 Thread espindola at gcc dot gnu dot org


--- Comment #2 from espindola at gcc dot gnu dot org  2009-10-28 21:32 
---
This testcase was fixed on revision 153685.


-- 

espindola at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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



[Bug lto/41858] New: -flto -O2 crashes when many source files.

2009-10-28 Thread bstarynk at gcc dot gnu dot org
When compiling a lot (e.g. 4000) source files with
   gcc-trunk -flto -O2 [A-Z]*.c -o big
the lto component crashes with sigsegv.

Version:
gcc version 4.5.0 20091028 (experimental) (GCC) 

that it the trunk rev 153680


-- 
   Summary: -flto -O2 crashes when many source files.
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Keywords: lto
  Severity: major
  Priority: P3
 Component: lto
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bstarynk at gcc dot gnu dot org
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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



[Bug lto/41858] -flto -O2 crashes when many source files.

2009-10-28 Thread bstarynk at gcc dot gnu dot org


--- Comment #1 from bstarynk at gcc dot gnu dot org  2009-10-28 21:40 
---
Created an attachment (id=18927)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18927&action=view)
a small program which generates many files to exhibit the bug

The attached main.c file generates many files.

Put it in a new directory (empty).

Compile it with 
   gcc -O main.c -o main

Run it to generate many files, for example
  ./main 4000

it should display messages ending with

generated function #3904 in E_150
generated function #3968 in Q_152
generated 4000 files last is W_153.c
try to compile all 4000 files with:
 gcc-trunk -flto -O2 -DGENERATEDALL main.c [A-Z]*.c -o big


Now, run the suggest command (replacing gcc-trunk with what is appropriate for
you).

Regards.


-- 


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



[Bug c++/41856] g++.dg/lookup/extern-c-redecl[3,4] .C scan-assembler fails on darwin

2009-10-28 Thread dominiq at lps dot ens dot fr


--- Comment #4 from dominiq at lps dot ens dot fr  2009-10-28 21:41 ---
On i686-apple-darwin9, with the patch I get:

Running target unix
Using /sw/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/gcc-4.5-work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /opt/gcc/gcc-4.5-work/gcc/testsuite/g++.dg/dg.exp ...
FAIL: g++.dg/lookup/extern-c-redecl4.C scan-assembler call[\t ]+_?_Z4forkv

=== g++ Summary for unix ===

# of expected passes11
# of unexpected failures1
Running target unix/-m64
Using /sw/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /sw/share/dejagnu/config/unix.exp as generic interface file for target.
Using /opt/gcc/gcc-4.5-work/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /opt/gcc/gcc-4.5-work/gcc/testsuite/g++.dg/dg.exp ...

=== g++ Summary for unix/-m64 ===

# of expected passes12

=== g++ Summary ===

# of expected passes23
# of unexpected failures1
/Volumes/MacBook/opt/gcc/i686-darwin/gcc/testsuite/g++/../../g++  version 4.5.0
20091028 (experimental) [trunk revision 153644p3d] (GCC) 

grepping the assembly file for ++.dg/lookup/extern-c-redecl4.C compiled with
-m32, I see

callL__Z4forkv$stub
callLPC$1

The failure disappears with the following patch:

--- ../_gcc_clean/gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C   
2009-10-26 17:19:09.0 +0100
+++ gcc/testsuite/g++.dg/lookup/extern-c-redecl4.C  2009-10-28
22:39:48.0 +0100
@@ -2,9 +2,9 @@
 // Origin: PR c++/41020

 // Avoid the "-ansi -pedantic" option
-// { dg-options "" }
+// { dg-options "-O0" }
 // { dg-do compile }
-// { dg-final { scan-assembler "call\[\t \]+_Z4forkv" } }
+// { dg-final { scan-assembler "call\[\t \]+L?_?_Z4forkv" { target i?86-*-*
x86_64-*-* } } }

 class frok
 {


-- 


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



[Bug lto/41858] -flto -O2 crashes when many source files.

2009-10-28 Thread bstarynk at gcc dot gnu dot org


--- Comment #2 from bstarynk at gcc dot gnu dot org  2009-10-28 21:47 
---
The attachment main.c is a source file generator and test case.

Put it in an empty directory.

First, compile it just with
  gcc main.c -o main
[you could add other flags to gcc, you can use any flavor of gcc]

Then run it once to generate many files.
  ./main 4000

Then it shows a lot of messages, ending with
 generated function #3968 in Q_152
generated 4000 files last is W_153.c
try to compile all 4000 files with:
 gcc-trunk -flto -O2 -DGENERATEDALL main.c [A-Z]*.c -o big

Do what it tells, so run the gcc trunk as said.


-- 


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



[Bug fortran/25829] [F2003] Asynchronous IO support

2009-10-28 Thread jb at gcc dot gnu dot org


--- Comment #13 from jb at gcc dot gnu dot org  2009-10-28 22:03 ---
Reassigning to myself, I have a plan how to proceed with supporting proper
async I/O in the library.


-- 

jb at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|jvdelisle at gcc dot gnu dot|jb at gcc dot gnu dot org
   |org |


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



[Bug lto/41858] -flto -O2 crashes when many source files.

2009-10-28 Thread rguenth at gcc dot gnu dot org


--- Comment #3 from rguenth at gcc dot gnu dot org  2009-10-28 22:10 ---
Well, it looks like you generated a pretty degenerate callgraph.  Trying
to reproduce.


-- 


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



[Bug lto/41858] -flto -O2 crashes when many source files.

2009-10-28 Thread bstarynk at gcc dot gnu dot org


--- Comment #4 from bstarynk at gcc dot gnu dot org  2009-10-28 22:22 
---
The linker is gold on Debian/Sid/Amd64 
% /usr/bin/ld -v
GNU gold (GNU Binutils for Debian 2.20) 1.9

It could be that it is that gold which crashes. Apparently, it open a lot of
files, and when getting the MFILE errno, something has a sigegv. Perhaps that
something is lto1.


-- 


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



[Bug fortran/41859] New: ICE on invalid expression involving DT with pointer components in I/O

2009-10-28 Thread burnus at gcc dot gnu dot org
The following program is rejected with NAG/ifort/g95 with:

error #6382: The result of an evaluation of an output item list must not be of
a derived type that ultimately contains a pointer component.

ERROR: Data transfer element at (1) cannot have POINTER components

ERROR: Derived type T in io-list has POINTER component NODENAME

gfortran crashes in trans-io.c


module inputdom
  type t
private
character, pointer, dimension(:) :: nodeName => null()
  end type t
contains
  subroutine getstructinput()
implicit none
print *, (foo()) ! <-- ICE here!
  end subroutine
  function foo()
type(t), pointer :: foo
foo => null()
  end function foo
end module inputdom


==16927== Invalid read of size 4
==16927==at 0xD25BE4: __gmpz_sub (aors.h:65)
==16927==by 0x56C5DE: transfer_array_component (trans-io.c:1947)
==16927==by 0x56C988: transfer_expr (trans-io.c:2108)


#1  0x0056c5df in transfer_array_component (expr=,
cm=0x149a910, where=)
at /home/tob/projects/gcc-trunk-checkout/gcc/fortran/trans-io.c:1947
#2  0x0056c989 in transfer_expr (se=0x7fffd250, ts=, addr_expr=, code=0x149d5f0)
at /home/tob/projects/gcc-trunk-checkout/gcc/fortran/trans-io.c:2108
#3  0x0057077b in gfc_trans_transfer (code=0x149d5f0) at
/home/tob/projects/gcc-trunk-checkout/gcc/fortran/trans-io.c:2244
#4  0x0053be88 in gfc_trans_code (code=0x149d5f0) at
/home/tob/projects/gcc-trunk-checkout/gcc/fortran/trans.c:1250
#5  0x0056e7a8 in build_dt (function=, code=)
at /home/tob/projects/gcc-trunk-checkout/gcc/fortran/trans-io.c:1814


-- 
   Summary: ICE on invalid expression involving DT with pointer
components in I/O
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org


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



[Bug other/31043] duplicated data in .rodata / .rodata.cst sections.

2009-10-28 Thread ubizjak at gmail dot com


--- Comment #4 from ubizjak at gmail dot com  2009-10-28 22:27 ---
(In reply to comment #3)

> > And this constant is handled in different way than its shadow in the memory.
> 
> could you explain why? they are identicial constants.
> -fmerge-constants should do something with this.

The load of constant into the register is expanded through ix86_expand_move in
"movdf" expander.  There we have:

  if (can_create_pseudo_p ()
  && FLOAT_MODE_P (mode)
  && GET_CODE (op1) == CONST_DOUBLE)
{
  /* If we are loading a floating point constant to a register,
 force the value to memory now, since we'll get better code
 out the back end.  */

  op1 = validize_mem (force_const_mem (mode, op1));
  if (!register_operand (op0, mode))
{
  rtx temp = gen_reg_rtx (mode);
  emit_insn (gen_rtx_SET (VOIDmode, temp, op1));
  emit_move_insn (op0, temp);
  return;
}
}

So, the trick would be to find the same FP constants in memory and load from
there.


-- 


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



[Bug fortran/41859] ICE on invalid expression involving DT with pointer components in I/O

2009-10-28 Thread burnus at gcc dot gnu dot org


--- Comment #1 from burnus at gcc dot gnu dot org  2009-10-28 22:32 ---
"If a list item of derived type in an unformatted input/output statement is not
processed by a user-defined derived-type input/output procedure (9.5.3.7), and
if any subobject of that list item would be processed by a user-defined
derived-type input/output procedure, the list item is treated as if all of the
components of the object were specified in the list in component order
(4.5.3.5); those components shall be accessible in the scoping unit containing
the input/output statement and shall not be pointers or allocatable.

If a list item of derived type in a formatted input/output statement is not
processed by a user-defined derived-type input/output procedure, that list item
is treated as if all of the components of the list item were specified in the
list in component order; those components shall be accessible in the scoping
unit containing the input/output statement and shall not be pointers or
allocatable.

If a derived-type list item is not treated as a list of its individual
components, that list item’s ultimate components shall not have the POINTER or
ALLOCATABLE attribute unless that list item is processed by a user-defined
derived-type input/output procedure." (F2003, 9.5.2).

 * * *

Note: The scope issue is also violated as the following example shows. Other
compilers get this right:

error #7300: This derived-type object in an input-output list cannot have
private components.

Error: Data transfer element at (1) cannot have PRIVATE components

Error: Derived type T in io-list has PRIVATE components


module inputdom
  type t
PRIVATE ! <
integer :: i
  end type t
end module

module m
  use inputdom
contains
  subroutine getstructinput()
implicit none
print *, (foo()) ! <<
  end subroutine
  function foo()
type(t), pointer :: foo
foo => null()
  end function foo
end module m


-- 

burnus at gcc dot gnu dot org changed:

   What|Removed |Added

   Keywords||accepts-invalid


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



[Bug fortran/41860] New: -finit-local-XXX clobbers -fno-automatic

2009-10-28 Thread jb at gcc dot gnu dot org
See the thread at

http://gcc.gnu.org/ml/fortran/2009-10/msg00217.html


-- 
   Summary: -finit-local-XXX clobbers -fno-automatic
   Product: gcc
   Version: 4.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jb at gcc dot gnu dot org


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



[Bug fortran/41860] -finit-local-XXX clobbers -fno-automatic

2009-10-28 Thread steven at gcc dot gnu dot org


-- 

steven at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-10-28 23:07:33
   date||


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



[Bug lto/41858] -flto -O2 crashes when many source files.

2009-10-28 Thread rguenth at gcc dot gnu dot org


--- Comment #5 from rguenth at gcc dot gnu dot org  2009-10-28 23:10 ---
Confirmed.  There's a file-descriptor leak (well, we kepp to many of them
open).


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-10-28 23:10:07
   date||


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



[Bug lto/41858] -flto -O2 crashes when many source files.

2009-10-28 Thread rguenth at gcc dot gnu dot org


--- Comment #6 from rguenth at gcc dot gnu dot org  2009-10-28 23:12 ---
I have a patch.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-10-28 23:10:07 |2009-10-28 23:12:19
   date||


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



[Bug fortran/41860] -finit-local-XXX clobbers -fno-automatic

2009-10-28 Thread jb at gcc dot gnu dot org


--- Comment #1 from jb at gcc dot gnu dot org  2009-10-28 23:25 ---
Subject: Bug 41860

Author: jb
Date: Wed Oct 28 23:25:08 2009
New Revision: 153689

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153689
Log:
PR fortran/41860 Treat vars as save with -fno-automatic

Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c


-- 


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



[Bug fortran/41860] -finit-local-XXX clobbers -fno-automatic

2009-10-28 Thread jb at gcc dot gnu dot org


-- 

jb at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jb at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-10-28 23:07:33 |2009-10-28 23:27:33
   date||


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



[Bug libstdc++/41861] New: does not use monotonic_clock

2009-10-28 Thread atgraham at gmail dot com
 looks like this:

171 #ifdef _GLIBCXX_USE_CLOCK_MONOTONIC
172 typedef chrono::monotonic_clock __clock_t;
173 #else
174 typedef chrono::high_resolution_clock   __clock_t;
175 #endif

...but  only has this:

56  typedef chrono::system_clock__clock_t;

Shouldn't  be using the monotonic_clock if available, just
like ?


-- 
   Summary:  does not use monotonic_clock
   Product: gcc
   Version: 4.4.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: atgraham at gmail dot com


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



[Bug rtl-optimization/41862] New: valgrind warns about using uninitialized variable with -fgcse-sm

2009-10-28 Thread zsojka at seznam dot cz
4.5.0 r153685 

Command line:
$ valgrind --track-origins=yes -v
/mnt/svn/gcc-trunk/binary-153685-lto/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1
-fpreprocessed testcase.i -m32 -O1 -version -fgcse-sm -o tmp.o

...

GNU C (GCC) version 4.5.0 20091028 (experimental) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.5.0 20091028 (experimental), GMP version
4.3.1, MPFR version 2.4.1-p5, MPC version 0.7 

...

==5211== 43 errors in context 1 of 2:   
==5211== Conditional jump or move depends on uninitialised value(s) 
==5211==at 0x7B2215: store_killed_after (store-motion.c:270)
==5211==by 0x7B3221: execute_rtl_store_motion (store-motion.c:1084) 
==5211==by 0x71349C: execute_one_pass (passes.c:1519)   
==5211==by 0x7136C4: execute_pass_list (passes.c:1568)  
==5211==by 0x7136D6: execute_pass_list (passes.c:1569)  
==5211==by 0x80B8B0: tree_rest_of_compilation (tree-optimize.c:392) 
==5211==by 0x9836AB: cgraph_expand_function (cgraphunit.c:1160) 
==5211==by 0x985524: cgraph_optimize (cgraphunit.c:1219)
==5211==by 0x985A5E: cgraph_finalize_compilation_unit (cgraphunit.c:1089)   
==5211==by 0x4AE2DA: c_write_global_declarations (c-decl.c:9489)
==5211==by 0x7B8CAB: toplev_main (toplev.c:1061)
==5211==by 0x6587A25: (below main) (in /lib64/libc-2.10.1.so)   
==5211==  Uninitialised value was created by a heap allocation  
==5211==at 0x4C270AC: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)  
==5211==by 0xC90C27: xmalloc (xmalloc.c:147)
==5211==by 0x7B30CB: execute_rtl_store_motion (store-motion.c:1066) 
==5211==by 0x71349C: execute_one_pass (passes.c:1519)   
==5211==by 0x7136C4: execute_pass_list (passes.c:1568)  
==5211==by 0x7136D6: execute_pass_list (passes.c:1569)  
==5211==by 0x80B8B0: tree_rest_of_compilation (tree-optimize.c:392) 
==5211==by 0x9836AB: cgraph_expand_function (cgraphunit.c:1160) 
==5211==by 0x985524: cgraph_optimize (cgraphunit.c:1219)
==5211==by 0x985A5E: cgraph_finalize_compilation_unit (cgraphunit.c:1089)   
==5211==by 0x4AE2DA: c_write_global_declarations (c-decl.c:9489)
==5211==by 0x7B8CAB: toplev_main (toplev.c:1061)
==5211==
==5211==
==5211== 2273 errors in context 2 of 2: 
==5211== Conditional jump or move depends on uninitialised value(s) 
==5211==at 0x7B21FD: store_killed_after (store-motion.c:270)
==5211==by 0x7B3221: execute_rtl_store_motion (store-motion.c:1084) 
==5211==by 0x71349C: execute_one_pass (passes.c:1519)   
==5211==by 0x7136C4: execute_pass_list (passes.c:1568)  
==5211==by 0x7136D6: execute_pass_list (passes.c:1569)  
==5211==by 0x80B8B0: tree_rest_of_compilation (tree-optimize.c:392) 
==5211==by 0x9836AB: cgraph_expand_function (cgraphunit.c:1160) 
==5211==by 0x985524: cgraph_optimize (cgraphunit.c:1219)
==5211==by 0x985A5E: cgraph_finalize_compilation_unit (cgraphunit.c:1089)   
==5211==by 0x4AE2DA: c_write_global_declarations (c-decl.c:9489)
==5211==by 0x7B8CAB: toplev_main (toplev.c:1061)
==5211==by 0x6587A25: (below main) (in /lib64/libc-2.10.1.so)   
==5211==  Uninitialised value was created by a heap allocation  
==5211==at 0x4C270AC: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)  
==5211==by 0xC90C27: xmalloc (xmalloc.c:147)
==5211==by 0x7B30CB: execute_rtl_store_motion (store-motion.c:1066) 
==5211==by 0x71349C: execute_one_pass (passes.c:1519)   
==5211==by 0x7136C4: execute_pass_list (passes.c:1568)  
==5211==by 0x7136D6: execute_pass_list (passes.c:1569)  
==5211==by 0x80B8B0: tree_rest_of_compilation (tree-optimize.c:392) 
==5211==by 0x9836AB: cgraph_expand_function (cgraphunit.c:1160) 
==5211==by 0x985524: cgraph_optimize (cgraphunit.c:1219)
==5211==by 0x985A5E: cgraph_finalize_compilation_unit (cgraphunit.c:1089)   
==5211==by 0x4AE2DA: c_write_global_declarations (c-decl.c:9489)
==5211==by 0x7B8CAB: toplev_main

[Bug rtl-optimization/41862] valgrind warns about using uninitialized variable with -fgcse-sm

2009-10-28 Thread zsojka at seznam dot cz


--- Comment #1 from zsojka at seznam dot cz  2009-10-29 00:04 ---
Created an attachment (id=18928)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18928&action=view)
partially reduced testcase


-- 


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



[Bug rtl-optimization/41862] valgrind warns about using uninitialized variable with -fgcse-sm

2009-10-28 Thread zsojka at seznam dot cz


--- Comment #2 from zsojka at seznam dot cz  2009-10-29 00:06 ---
Created an attachment (id=18929)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18929&action=view)
warning disappears when this diff is applied


-- 


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



[Bug libstdc++/41861] does not use monotonic_clock

2009-10-28 Thread paolo dot carlini at oracle dot com


--- Comment #1 from paolo dot carlini at oracle dot com  2009-10-29 00:31 
---
Chris, can you have a look to this issue? Thanks.


-- 

paolo dot carlini at oracle dot com changed:

   What|Removed |Added

 CC||cfairles at gcc dot gnu dot
   ||org


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



[Bug c++/41863] New: [4.5 Regression] segfault with sizeof in template parameter

2009-10-28 Thread foom at fuhm dot net
GCC 4.5 appears to fail when using sizeof(member-of-templated-type) inside a
template parameter.

I have tested the Debian gcc-snapshot 20090923-1 amd64 package, 20091010-1
i386, and Ubuntu gcc-snapshot 20091018-1 amd64. All exhibit the same behavior.
g++-4.4 works fine, however.

Changing to "sizeof(m_foo)" to "sizeof(T)" also fixes the problem.

File /tmp/test.cpp:
===CUT===
template struct Bar {
};

template
class Foo {
T m_foo;
void crash() {
Bar bar;
}
};
===CUT===

$ g++ -c /tmp/test.cpp

/tmp/test.cpp: In member function 'void Foo::crash()':
/tmp/test.cpp:8:26: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.


-- 
   Summary: [4.5 Regression] segfault with sizeof in template
parameter
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: foom at fuhm dot net
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


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



[Bug c++/41864] New: GCC optimization error

2009-10-28 Thread chuongdo at cs dot stanford dot edu
In this program, I am taking a 64-bit double and reinterpreting it as a 64-bit
long long.  I am then reinterpreting that as a 64-bit double again.  The
expected output of the program is "1", but when compiling with -O2, the answer
is gibberish.

---

chuon...@kartoo:~/speed$ cat bug2.cc
#include 
#include 

using namespace std;

int main(int argc, char **argv) {
  double x = 1;
  long long y = *(long long *)(void *)&x;
  double z = *(double *)(void *)&y;
  z = *(double *)(void *)&y;
  cerr << z << endl;
  return 0;
}
chuon...@kartoo:~/speed$ g++ --version
g++ (Ubuntu 4.3.3-5ubuntu4) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

chuon...@kartoo:~/speed$ uname -a
Linux kartoo 2.6.28-15-generic #52-Ubuntu SMP Wed Sep 9 10:48:52 UTC 2009
x86_64 GNU/Linux
chuon...@kartoo:~/speed$ g++ -o bug2 bug2.cc
chuon...@kartoo:~/speed$ ./bug2
1
chuon...@kartoo:~/speed$ g++ -o bug2 bug2.cc -O2
chuon...@kartoo:~/speed$ ./bug2
6.95328e-310


-- 
   Summary: GCC optimization error
   Product: gcc
   Version: 4.3.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: chuongdo at cs dot stanford dot edu


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



[Bug c++/41864] GCC optimization error

2009-10-28 Thread pinskia at gcc dot gnu dot org


--- Comment #1 from pinskia at gcc dot gnu dot org  2009-10-29 05:49 ---
You are volating C/C++ aliasing rules even with the casts to void*.  What
matters is the type of accesses.

*** This bug has been marked as a duplicate of 21920 ***


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||DUPLICATE


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



[Bug c/21920] aliasing violations

2009-10-28 Thread pinskia at gcc dot gnu dot org


--- Comment #148 from pinskia at gcc dot gnu dot org  2009-10-29 05:49 
---
*** Bug 41864 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||chuongdo at cs dot stanford
   ||dot edu


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



[Bug c++/41865] New: map as class static member variable causing crash on process exit

2009-10-28 Thread ganesh dot borse at credit-suisse dot com
Hi,
Our application is crashing at the time of exit when a static member variable
of this following typedef is getting cleared by garbage collecter:
typedef STL_NS::map
FBOperatorPrecedence;

This map is defined as protected:
static FBOperatorPrecedence ops_;
static int init_;
static int fillit();

fillit() function is used to populate this map as below:
ops_["+"]  = FBOperator( n, FBOperator::Binary, OPPLUS,   false,
&FBOperand::operator+ );
ops_["-"]  = FBOperator( n, FBOperator::Binary, OPMINUS,  false,
&FBOperand::operator- );
ops_["*"]  = FBOperator( n, FBOperator::Binary, OPTIMES,  false,
&FBOperand::operator* );
ops_["/"]  = FBOperator( n, FBOperator::Binary, OPDIV,false,
&FBOperand::operator/ );
ops_["<"]  = FBOperator( n, FBOperator::Binary, OPLT, false,
&FBOperand::operator< );
ops_[">"]  = FBOperator( n, FBOperator::Binary, OPGT, false,
&FBOperand::operator> );
ops_["<="] = FBOperator( n, FBOperator::Binary, OPLTEQ,   false,
&FBOperand::operator<= );
ops_[">="] = FBOperator( n, FBOperator::Binary, OPGTEQ,   false,
&FBOperand::operator>= );
ops_["="]  = FBOperator( n, FBOperator::Binary, OPEQ, false,
&FBOperand::operator== );
ops_["=="] = FBOperator( n, FBOperator::Binary, OPEQ, false,
&FBOperand::operator== ) ;
ops_["is" ]= FBOperator( n, FBOperator::Binary, OPEQ, false,
&FBOperand::operator== );
ops_["!="] = FBOperator( n, FBOperator::Binary, OPNE, false,
&FBOperand::operator!= ) ;
ops_["<>"] = FBOperator( n, FBOperator::Binary, OPNE, false,
&FBOperand::operator!= );
ops_["isnot"]  = FBOperator( n, FBOperator::Binary, OPNE, false,
&FBOperand::operator!= );
ops_["&&"] = FBOperator( n++, FBOperator::Binary, OPLAND,   false,
&FBOperand::operator&& );
ops_["&"]  = FBOperator( n, FBOperator::Binary, OPBAND,   false,
&FBOperand::bitwiseand);
ops_["and"]= FBOperator( n, FBOperator::Binary, OPLAND,   false,
&FBOperand::operator&& );
ops_["AND"]= FBOperator( n, FBOperator::Binary, OPLAND,   false,
&FBOperand::operator&& );
ops_["or"] = FBOperator( n, FBOperator::Binary, OPLOR,false,
&FBOperand::operator|| );
ops_["OR"] = FBOperator( n, FBOperator::Binary, OPLOR,false,
&FBOperand::operator|| );
ops_["||"] = FBOperator( n, FBOperator::Binary, OPLOR,false,
&FBOperand::operator|| );
ops_["|"]  = FBOperator( n, FBOperator::Binary, OPBOR,false,
&FBOperand::bitwiseor );
ops_["in"] = FBOperator( n, FBOperator::Binary, OPIN, true, 
&FBOperand::in  );
ops_["notin"]  = FBOperator( n, FBOperator::Binary, OPNOTIN,  true, 
&FBOperand::notin  );
ops_["like"]   = FBOperator( n, FBOperator::Binary, OPLIKE,   true, 
&FBOperand::like );
ops_["notlike"]= FBOperator( n, FBOperator::Binary, OPNOTLIKE,true, 
&FBOperand::notlike  );
ops_["!"]  = FBOperator( ++n, FBOperator::Unary,  OPNOT,false, (opfn)0
);
ops_["not"]= FBOperator( ++n, FBOperator::Unary,  OPNOT,false, (opfn)0
);

When program exits, at that time this static member variable gets deleted by
garbage collector & causes program to abort. Following output is shown on the
screen:
*** glibc detected *** ./a.out: double free or corruption (!prev):
0x00544250 ***
=== Backtrace: =
/lib64/libc.so.6[0x2b1a463ab34e]
/lib64/libc.so.6(__libc_free+0x6c)[0x2b1a463ac95c]
./a.out[0x420299]
./a.out[0x4202c1]
./a.out[0x42030c]
./a.out[0x420355]
./a.out[0x42033b]
./a.out[0x42033b]
./a.out[0x42033b]
./a.out[0x42033b]
./a.out[0x4209ce]
./a.out[0x420a23]
./a.out[0x41651e]
/lib64/libc.so.6(exit+0x87)[0x2b1a463722a7]
/lib64/libc.so.6(__libc_start_main+0xfb)[0x2b1a4635d15b]
./a.out(__gxx_personality_v0+0xa9)[0x404c59]
=== Memory map: 
0040-0043a000 r-xp  00:20 916340
/home/gborse/a.out
00539000-0053b000 rw-p 00039000 00:20 916340
/home/gborse/a.out
0053b000-0055c000 rw-p 0053b000 00:00 0  [heap]
2b1a459e3000-2b1a459fe000 r-xp  08:02 350653
/lib64/ld-2.4.so
2b1a459fe000-2b1a45a0 rw-p 2b1a459fe000 00:00 0
2b1a45afd000-2b1a45aff000 rw-p 0001a000 08:02 350653
/lib64/ld-2.4.so
2b1a45aff000-2b1a45c6e000 r-xp  08:11 345510
/app/thirdpartylibs/gmrACE-5.6-64/lib/libACE-5.6.so
2b1a45c6e000-2b1a45d6e000 ---p 0016f000 08:11 345510
/app/thirdpartylibs/gmrACE-5.6-64/lib/libACE-5.6.so
2b1a45d6e000-2b1a45db2000 rw-p 0016f000 08:11 345510
/app/thirdpartylibs/gmrACE-5.6-64/lib/libACE-5.6.so
2b1a45db2000-2b1a45db3000 rw-p 2b1a45db2000 00:00 0
2b1a45db3000-2b1a45e82000 r-xp  08:11 1016022   
/app/devtools/gcc-4.2.3/lib64/libstdc++.so.6.0.9
2b1a45e82000-2b1a45f82000 ---p 000cf000 08:11 1016022   
/app/devtools/gcc-4.2.3/lib64/libstdc++.so.6.0.9
2b1a45f82000-2b1a45fa3000 rw-p 000cf000 08:11 1016022   
/app/devtools/gcc-4.2.3/lib64/libstdc++.so.6.0.9
2b