[Bug c/33111] New: Bad code generation with -O2 (ARM 7 architecture)

2007-08-19 Thread gressau at optusnet dot com dot au
#define UIP_LLH_LEN 1
#define BUF ((uip_tcpip_hdr *)uip_buf[UIP_LLH_LEN])
#define u8_t unsigned char
#define u16_t unsigned short
#define UIP_BUFSIZE 1000

typedef struct {
  /* IP header. */
  u8_t vhl,
tos,  
len[2],   
ipid[2],
ipoffset[2],  
ttl,  
proto; 
  u16_t ipchksum;
  u16_t srcipaddr[2], 
destipaddr[2];

  /* TCP header. */
  u16_t srcport,
destport;
  u8_t seqno[4],  
ackno[4],
tcpoffset,
flags,
wnd[2]; 
  u16_t tcpchksum;
  u8_t urgp[2];
  u8_t optdata[4];
} uip_tcpip_hdr;


u8_t uip_buf[UIP_BUFSIZE+2];
volatile u8_t uip_acc32[4];

int jaroslav;

int main(void)
{
if((BUF-ackno[0] == uip_acc32[0]) 
(BUF-ackno[1] == uip_acc32[1]) 
(BUF-ackno[2] == uip_acc32[2]) 
(BUF-ackno[3] == uip_acc32[3]))
jaroslav++;
return 1;
}

.file   main.c
.text
.align  2
.global main
.type   main, %function
main:
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
@ link register save eliminated.
ldr r0, .L10
ldr r1, .L10+4
ldrbr2, [r0, #28]   @ zero_extendqisi2
ldrbr3, [r1, #0]@ zero_extendqisi2
cmp r2, r3
@ lr needed for prologue
beq .L9
.L2:
mov r0, #1
bx  lr
.L9:
ldrbr2, [r1, #1]@ zero_extendqisi2
ldrbr3, [r0, #29]   @ zero_extendqisi2
cmp r3, r2
bne .L2
ldrbr2, [r1, #2]@ zero_extendqisi2
ldrbr3, [r0, #30]   @ zero_extendqisi2
cmp r3, r2
bne .L2
ldrbr2, [r1, #3]@ zero_extendqisi2
ldrbr3, [r0, #31]   @ zero_extendqisi2
cmp r3, r2 I THINK CC's OF THIS
COMPARE NEVER GET LOOKED AT
ldreq   r2, .L10+8
ldreq   r3, [r2, #0]
addeq   r3, r3, #1
streq   r3, [r2, #0]
b   .L2
.L11:
.align  2
.L10:
.word   uip_buf+1
.word   uip_acc32
.word   jaroslav
.size   main, .-main
.comm   uip_buf,1002,1
.comm   uip_acc32,4,1
.comm   jaroslav,4,4
.ident  GCC: (GNU) 4.2.0


-- 
   Summary: Bad code generation with -O2 (ARM 7 architecture)
   Product: gcc
   Version: 4.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gressau at optusnet dot com dot au


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



[Bug c/33111] Bad code generation with -O2 (ARM 7 architecture)

2007-08-19 Thread pinskia at gcc dot gnu dot org


--- Comment #1 from pinskia at gcc dot gnu dot org  2007-08-19 08:59 ---
 #define BUF ((uip_tcpip_hdr *)uip_buf[UIP_LLH_LEN])
Right there is an alias violation.


-- 


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



[Bug rtl-optimization/32557] [4.3 Regression] internal compiler error: RTL check: expected code 'reg', have 'subreg' in rhs_regno, at rtl.h:956

2007-08-19 Thread patchapp at dberlin dot org


--- Comment #4 from patchapp at dberlin dot org  2007-08-19 12:30 ---
Subject: Bug number PR rtl-optimization/32557

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-08/msg01210.html


-- 


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



[Bug c++/33112] New: ICE : canonical types differ for identical types const _CharT* [14] and const _CharT* [14]

2007-08-19 Thread sylvain dot pion at sophia dot inria dot fr
This is with today's g++ 4.3, but has been there for a few weeks:

Configured with: /proj/geometrica/home/GCC/trunk/configure
--with-gmp=/proj/geometrica/home/MPFR/MPFR-2.2.1/FC5 --disable-shared
--disable-nls --enable-languages=c++,fortran
--prefix=/proj/geometrica/home/GCC/Linux-fc5-4.3
Thread model: posix
gcc version 4.3.0 20070819 (experimental)

Compiling the attached preprocessed file with -c -O2 produces the
following ICE.  Note that it is not deterministic: you usually need
to repeat the compile 10-20 times to see it...

[EMAIL PROTECTED]:/proj/geometrica/home/CGAL/CGAL-I/src/CGAL while
(/proj/geometrica/home/GCC/Linux-fc5-4.3/bin/g++   -c JAMA_numeric_solver.ii
-O2 ) ;
do ; echo OK ;done;
OK
OK
OK
OK
OK
In file included from
/auto/papillon/u/papillon/0/projserver/geometrica/home/GCC/Linux-fc5-4.3/bin/../lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/locale:49,
 from
/proj/geometrica/home/CGAL/CGAL-I/include/CGAL/Quotient.h:41,
 from
/proj/geometrica/home/CGAL/CGAL-I/include/CGAL/Root_of_traits.h:27,
 from
/proj/geometrica/home/CGAL/CGAL-I/include/CGAL/number_type_basic.h:87,
 from
/proj/geometrica/home/CGAL/CGAL-I/include/CGAL/basic.h:36,
 from
/proj/geometrica/home/CGAL/CGAL-I/include/CGAL/Polynomial/internal/macros.h:31,
 from
/proj/geometrica/home/CGAL/CGAL-I/include/CGAL/Polynomial/basic.h:42,
 from
/proj/geometrica/home/CGAL/CGAL-I/include/CGAL/Polynomial/internal/numeric_solvers_support.h:24,
 from JAMA_numeric_solver.cpp:22:
/auto/papillon/u/papillon/0/projserver/geometrica/home/GCC/Linux-fc5-4.3/bin/../lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/locale_facets_nonio.h:176:
internal compiler error: canonical types differ for identical types const
_CharT* [14] and const _CharT* [14]
Please submit a full bug report,
with preprocessed source if appropriate.
See URL:http://gcc.gnu.org/bugs.html for instructions.


I have also been able to reproduce it with only -O.


-- 
   Summary: ICE : canonical types differ for identical types const
_CharT* [14] and const _CharT* [14]
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sylvain dot pion at sophia dot inria dot fr
  GCC host triplet: i686-pc-linux-gnu


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



[Bug c++/33112] ICE : canonical types differ for identical types const _CharT* [14] and const _CharT* [14]

2007-08-19 Thread sylvain dot pion at sophia dot inria dot fr


--- Comment #1 from sylvain dot pion at sophia dot inria dot fr  2007-08-19 
12:55 ---
Created an attachment (id=14076)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14076action=view)
Compressed pre-processed C++ source code


-- 


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



[Bug target/30315] optimize unsigned-add overflow test on x86 to use cpu flags from addl

2007-08-19 Thread rask at gcc dot gnu dot org


--- Comment #12 from rask at gcc dot gnu dot org  2007-08-19 13:00 ---
 void *foo(unsigned a, unsigned b) {
 unsigned sum = a + b;
 if (sum  a) return 0;
 if (sum == 0) sum = 1;

To be able to optimize both comparisons, we need to have the same comparison
operands. The only way I can see this happening is to canonicalize the overflow
check as a + b  0 with the obvious fear that since a and b are both
unsigned, GCC will optimize the comparison away as always false - unless taught
not to do so. I'll see what I can do.

Additionally, the resulting asm seems to be a bit stupid:

testl   %edx,   %edx
movl$1, %eax
cmove   %eax,   %edx

should be just

testl   %edx,   %edx
sete%dl


-- 

rask at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |rask at gcc dot gnu dot org
   |dot org |
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2007-08-19 13:00:47
   date||


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



[Bug c++/33112] ICE : canonical types differ for identical types const _CharT* [14] and const _CharT* [14]

2007-08-19 Thread steven at gcc dot gnu dot org


-- 

steven at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||dgregor at gcc dot gnu dot
   ||org
 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2007-08-19 13:04:48
   date||


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



[Bug c/33111] Bad code generation with -O2 (ARM 7 architecture)

2007-08-19 Thread gressau at optusnet dot com dot au


--- Comment #2 from gressau at optusnet dot com dot au  2007-08-19 13:23 
---
The attached sample code does not illustrate the real problem.
Further investigation is required why the code works with -O0 
and does not work with -O2.


-- 

gressau at optusnet dot com dot au changed:

   What|Removed |Added

 CC|gressau at optusnet dot com |
   |dot au  |


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



[Bug tree-optimization/33113] New: Failing to represent the stride of a dataref when it is not a constant

2007-08-19 Thread dorit at gcc dot gnu dot org
In the following testcase:

subroutine sub(aa,bb,n,m)
  implicit none
  integer, intent(in) :: n,m
  real, intent(inout) :: aa(n,m)
  real, intent(in):: bb(n,m)
  integer :: i,j
 do i = 1,m
do j= 2,n
  aa(i,j)= aa(i,j-1)+bb(i,j-1)
enddo
  enddo
end subroutine
end

The stride of the accesses in the inner-loop is a parameter (m is not a
compile-time known constant). As a result the data dataref analyzer reports:

failed: evolution of offset is not affine
...
base_address:
offset from base address:
constant offset from base address:
step:
aligned to:
base_object: (*aa_54(D))[0]
symbol tag: SMT.25


Any chance that the dataref analysis can return an (invariant) expression in
step, so that further analysis could continue? (for example, the access in
the outer-loop is consecutive, so if we had an expression to represent the
inner-loop stride, we could vectorize the outer-loop).


-- 
   Summary: Failing to represent the stride of a dataref when it is
not a constant
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: normal
  Priority: P3
 Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dorit at gcc dot gnu dot org
 GCC build triplet: powerpc64-linux
  GCC host triplet: powerpc64-linux
GCC target triplet: powerpc64-linux


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



[Bug tree-optimization/32378] can't determine dependence (distinct sections of an array)

2007-08-19 Thread dorit at gcc dot gnu dot org


--- Comment #6 from dorit at gcc dot gnu dot org  2007-08-19 13:47 ---
 Sebastian - any thughts/plans?

Here's another testcase:

subroutine sub(aa,bb,n,m)
  implicit none
  integer, intent(in) :: n,m
  real, intent(inout) :: aa(n,m)
  real, intent(in):: bb(n,m)
  integer :: i,j
 do j= 2,n
do i = 1,m
  aa(i,j)= aa(i,j-1)+bb(i,j-1)
enddo
  enddo
end subroutine
end

Here too we get:

(compute_affine_dependence
  (stmt_a =
D.1385_55 = (*aa_54(D))[D.1384_53])
  (stmt_b =
(*aa_54(D))[D.1380_49] = D.1390_62)
(subscript_dependence_tester
(analyze_overlapping_iterations
  (chrec_a = {pretmp.34_76 + 1, +, 1}_2)
  (chrec_b = {pretmp.34_32 + 1, +, 1}_2)
(analyze_siv_subscript
siv test failed: unimplemented.
)
  (overlap_iterations_a = not known
)
  (overlap_iterations_b = not known
)
)
(dependence classified: scev_not_known)
)
)


-- 


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



[Bug tree-optimization/33114] New: jc1 segault building lljava/java/util/AbstractMap.java

2007-08-19 Thread dps at simpson dot demon dot co dot uk
Using gcc 4.3.0 20070818 (experimental) has tI hit the following problem
building libjava

libtool: compile:  /home/dps/src/egcs/gcc-i686/gcc/gcj
-B/home/dps/src/egcs/gcc-i686/i686-pc-linux-gnu/libjava/
-B/home/dps/src/egcs/gcc-i686/gcc/ -ffloat-store -fomit-frame-pointer -Usun
-fclasspath= -fbootclasspath=../../../gcc/libjava/classpath/lib
--encoding=UTF-8 -Wno-deprecated -fbootstrap-classes -g -O2 -c
-fsource-filename=/home/dps/src/egcs/gcc-i686/i686-pc-linux-gnu/libjava/classpath/lib/classes
-MT java/util.lo -MD -MP -MF java/util.deps @java/util.list  -fPIC -o
java/.libs/util.o
../../../../../gcc/libjava/classpath/java/util/AbstractMap.java: In class
'java.util.AbstractMap$2$1':
../../../../../gcc/libjava/classpath/java/util/AbstractMap.java: In constructor
'(java.util.AbstractMap$2)':
../../../../../gcc/libjava/classpath/java/util/AbstractMap.java:604: error:
class 'java.util.AbstractMap$2' has no method named 'access$0' matching
signature '(Ljava/util/AbstractMap$2;)Ljava/util/AbstractMap;'
../../../../../gcc/libjava/classpath/java/util/AbstractMap.java: In class
'java.util.AbstractMap$3':
../../../../../gcc/libjava/classpath/java/util/AbstractMap.java: In method
'access$0(java.util.AbstractMap$3)':
../../../../../gcc/libjava/classpath/java/util/AbstractMap.java:0: internal
compiler error: Segmentation fault

Apprerently the reason for this that fini_ssa_operands is called more times
than init_ssa_operands. Backtrace of call with n_initialized=0 is

(gdb) bt
#0  fini_ssa_operands () at ../../gcc/gcc/tree-ssa-operands.c:389
#1  0x08403a40 in delete_tree_ssa () at ../../gcc/gcc/tree-ssa.c:866
#2  0x0832fedc in execute_free_datastructures () at
../../gcc/gcc/tree-optimize.c:215
#3  0x0824b79f in execute_one_pass (pass=0x87c3540) at
../../gcc/gcc/passes.c:1108
#4  0x0824b99f in execute_pass_list (pass=0x87c3540) at
../../gcc/gcc/passes.c:1161
#5  0x0832ffed in tree_rest_of_compilation (fndecl=0xb7c98f80) at
../../gcc/gcc/tree-optimize.c:405
#6  0x084a5cf0 in cgraph_expand_function (node=0xb7454280) at
../../gcc/gcc/cgraphunit.c:1077
#7  0x084a7060 in cgraph_assemble_pending_functions () at
../../gcc/gcc/cgraphunit.c:440
#8  0x084a74ed in cgraph_finalize_function (decl=0xb7c98f80, nested=0 '\0') at
../../gcc/gcc/cgraphunit.c:557
#9  0x08064889 in finish_method (fndecl=0xb7c98f80) at
../../gcc/gcc/java/decl.c:1859
#10 0x08070415 in end_java_method () at ../../gcc/gcc/java/decl.c:1807
#11 0x08095308 in parse_class_file () at ../../gcc/gcc/java/jcf-parse.c:1689
#12 0x08095cf3 in java_parse_file (set_yydebug=0) at
../../gcc/gcc/java/jcf-parse.c:1980
#13 0x082ce838 in toplev_main (argc=34, argv=0xbfdc8ba4) at
../../gcc/gcc/toplev.c:1043
#14 0x080a15bf in main (argc=Cannot access memory at address 0x4
) at ../../gcc/gcc/main.c:35

n_initialized reaches -4 and then the code segaults on line 1092 of
upodate_stmt_operands. Backtrace is

#0  0x083c46b3 in update_stmt_operands (stmt=0xb7469c40) at
../../gcc/gcc/tree-ssa-operands.c:1092
#1  0x082d3742 in bsi_insert_after (i=0xbfdc8780, t=0xb7469c40, m=BSI_NEW_STMT)
at ../../gcc/gcc/tree-flow-inline.h:368
#2  0x084c83ff in copy_body (id=0xbfdc881c, count=value optimized out,
frequency=0, entry_block_map=0xb746b8e8, exit_block_map=0xb746b924) at
../../gcc/gcc/tree-inline.c:811
#3  0x084c9b8d in tree_function_versioning (old_decl=0xb7ca0200,
new_decl=0xb7467680, tree_map=0x0, update_clones=1 '\001') at
../../gcc/gcc/tree-inline.c:3445
#4  0x084a6b97 in save_inline_function_body (node=0xb7467380) at
../../gcc/gcc/cgraphunit.c:1626
#5  0x084ac22e in apply_inline () at ../../gcc/gcc/ipa-inline.c:1580
#6  0x0824b79f in execute_one_pass (pass=0x87c4ca0) at
../../gcc/gcc/passes.c:1108
#7  0x0824b99f in execute_pass_list (pass=0x87c4ca0) at
../../gcc/gcc/passes.c:1161
#8  0x0832ffed in tree_rest_of_compilation (fndecl=0xb7ca0200) at
../../gcc/gcc/tree-optimize.c:405
#9  0x084a5cf0 in cgraph_expand_function (node=0xb7467380) at
../../gcc/gcc/cgraphunit.c:1077
#10 0x084a7060 in cgraph_assemble_pending_functions () at
../../gcc/gcc/cgraphunit.c:440
#11 0x084a74ed in cgraph_finalize_function (decl=0xb7ca0200, nested=0 '\0') at
../../gcc/gcc/cgraphunit.c:557
#12 0x08064889 in finish_method (fndecl=0xb7ca0200) at
../../gcc/gcc/java/decl.c:1859
#13 0x08070415 in end_java_method () at ../../gcc/gcc/java/decl.c:1807
#14 0x08095308 in parse_class_file () at ../../gcc/gcc/java/jcf-parse.c:1689
#15 0x08095cf3 in java_parse_file (set_yydebug=0) at
../../gcc/gcc/java/jcf-parse.c:1980
#16 0x082ce838 in toplev_main (argc=34, argv=0xbfdc8ba4) at
../../gcc/gcc/toplev.c:1043
#17 0x080a15bf in main (argc=65715, argv=0x0) at ../../gcc/gcc/main.c:35


-- 
   Summary: jc1 segault building lljava/java/util/AbstractMap.java
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dps at simpson dot demon dot 

[Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file

2007-08-19 Thread tromey at gcc dot gnu dot org


--- Comment #4 from tromey at gcc dot gnu dot org  2007-08-19 16:13 ---
I'm testing this patch.


-- 

tromey at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |tromey at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2007-02-13 15:55:12 |2007-08-19 16:13:10
   date||


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



[Bug fortran/33106] Access of components of public entities of private types wrongly allowed

2007-08-19 Thread dfranke at gcc dot gnu dot org


--- Comment #1 from dfranke at gcc dot gnu dot org  2007-08-19 17:05 ---
Confirmed and taken.


-- 

dfranke at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||dfranke at gcc dot gnu dot
   ||org
 AssignedTo|unassigned at gcc dot gnu   |dfranke at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2007-08-19 17:05:50
   date||


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



[Bug fortran/33106] Access of components of public entities of private types wrongly allowed

2007-08-19 Thread dfranke at gcc dot gnu dot org


--- Comment #2 from dfranke at gcc dot gnu dot org  2007-08-19 17:40 ---
 The print statements are wrong(?); additionally for -std=f95 there 
 should be already an error for the compilation of the module.

Tobias,

does any other standard but F95 allow the usage of private derived type outside
their defining module? I'd think that an error is called for, regardless of the
version of the standard?!


-- 


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



[Bug fortran/33106] Access of components of public entities of private types wrongly allowed

2007-08-19 Thread burnus at gcc dot gnu dot org


--- Comment #3 from burnus at gcc dot gnu dot org  2007-08-19 17:50 ---
 does any other standard but F95 allow the usage of private derived type 
 outside their defining module? I'd think that an error is called for, 
 regardless of the version of the standard?!

Believing NAG the following is allowed in Fortran 2003 but not in Fortran 95:

module m
  type, private :: hidden_type; character(6) :: code; end type
  type(hidden_type), public, parameter :: code_green = hidden_type('green')
end module
use m, only: code_green, module_procedure_of_m
call module_procedure_of_m(code_green)

use m, only: hidden_type is definitely invalid. I would expect that also
print *, code_green and print *, code_green%code is invalid.

According to NAG is for Fortran 95 type(hidden_type), public already wrong.

I will try to find the relevant part in the Fortran 95 and 2003 standard (is
probably a bit hidden).


-- 


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



[Bug target/30315] optimize unsigned-add overflow test on x86 to use cpu flags from addl

2007-08-19 Thread ubizjak at gmail dot com


--- Comment #13 from ubizjak at gmail dot com  2007-08-19 18:03 ---
(In reply to comment #12)

  if (sum == 0) sum = 1;
 

 Additionally, the resulting asm seems to be a bit stupid:
 
 testl   %edx,   %edx
 movl$1, %eax
 cmove   %eax,   %edx
 
 should be just
 
 testl   %edx,   %edx
 sete%dl

Not, because sete sets dl to 0 (zero) when condition is not met. The c code
above doesn't change sum when sum != 0.

Regarding the problem, described in comment #11:

Perhaps we can add CCCZmode as a common mode to otherwise orthogonal CCCmode
and CCZmode. Playing with i386_cc_modes_compatible() and ix86_match_cc_mode()
we can perhaps teach combine to CSE and merge two comparisons. To achieve this,
I think we should use (enhanced) ix86_match_cc_mode() in just added RTL
patterns.


-- 


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



[Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file

2007-08-19 Thread tromey at gcc dot gnu dot org


--- Comment #5 from tromey at gcc dot gnu dot org  2007-08-19 18:19 ---
A program like '_Pragma /*comment*/' still gives an ICE.
I'm testing an updated patch.


-- 


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



[Bug fortran/33106] Access of components of public entities of private types wrongly allowed

2007-08-19 Thread burnus at gcc dot gnu dot org


--- Comment #4 from burnus at gcc dot gnu dot org  2007-08-19 18:54 ---
Fortran 2003:
---
4.5.1.1   Accessibility
Types that are defined in a module or accessible in that module by use
association have either the PUBLIC or PRIVATE attribute. Types for which an
access-spec is not explicitly specified in that module have the default
accessibility attribute for that module. The default accessibility attribute
for a module is PUBLIC unless it has been changed by a PRIVATE statement
(5.2.1). Only types that have the PUBLIC attribute in that module are available
to be accessed from that module by use association.
The accessibility of a type does not affect, and is not affected by, the
accessibility of its components and bindings.
If a type definition is private, then the type name, and thus the structure
constructor (4.5.9) for the type, are accessible only within the module
containing the definition.
---

Fortran 95:
---
4.4.1 Derived-type definition
[...]
The accessibility of a derived type may be declared explicitly by an
access-spec in its derived-type-stmt or in an access-stmt (5.2.3). The
accessibility is the default if it is not declared explicitly. If a type
definition is private, then the type name, the structure constructor (4.4.4)
for the type, any entity that is of the type, and any procedure that has a
dummy argument or function result that is of the type are accessible only
within the module containing the definition.
If a type definition contains a PRIVATE statement, the component names for the
type are accessible only within the module containing the definition, even if
the type itself is public (5.1.2.2). The component names and hence the internal
structure of the type are inaccessible in any scoping unit accessing the module
via a USE statement. Similarly, the structure constructor for such a type shall
be employed only within the defining module.
---

Fortran 95 prohibits: If a type definition is private, then [...] any entity
that is of the type, and any procedure that has a dummy argument or function
result that is of the type are accessible only within the module.

But Fortran 2003 only prohibits the type name and structure constructor. Thus
entities and procedures with dummy arguments of this type are allowed.

I would also argue that in Fortran 2003:
 print *, code_green%code
is allowed as The accessibility of a type does not affect, and is not affected
by, the accessibility of its components. Which agrees with NAG f95.

For
  print *, code_green
I am not fully sure, but one may argue that the type definition of a PRIVATE
type (name) is PRIVATE and thus also the type spec of code_green. This seems to
be the line NAG f95 follows.


-- 


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



[Bug preprocessor/30786] [4.1/4.2/4.3 Regression] ICE on _Pragma at end of file

2007-08-19 Thread tromey at gcc dot gnu dot org


--- Comment #6 from tromey at gcc dot gnu dot org  2007-08-19 18:54 ---
What does a plain _Pragma mean?
Currently we try to give an error for this.  However, it is not clear that
this is actually erroneous.  The copy of the standard that I am reading
only mentions:

A unary operator expression of the form:
  _Pragma ( string-literal )

... but a plain _Pragma does not have that form.
I'm not even sure that _Pragma(something-other-than-string-literal)
should be recognized (but I'm new to C standardese...)

Perhaps I have the wrong version of the standard or perhaps there
is some more recent development of which I'm unaware.

Anyway if we assume that a plain _Pragma is not an error then the first
patch here is close to the correct one -- it just returns the plain
_Pragma to the FE as an identifier.  If all forms other than the
full form are unrecognized then I think this first patch is correct.


-- 


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



[Bug tree-optimization/30564] [4.3 Regression] ice for legal code with -O3

2007-08-19 Thread pinskia at gcc dot gnu dot org


--- Comment #14 from pinskia at gcc dot gnu dot org  2007-08-19 19:07 
---
The testcases here don't crash anymore but the one from PR 32033 does:


static int spready[] = {
};
void explosion_map (int y)
{
  for (int i = 0; i  4; i++)
if (y * spready[i]  0)
  break;
}
void explosion (void)
{
  explosion_map (0);
  for (int i = 0; i  2; i++)
continue;
}


-- 


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



[Bug tree-optimization/30564] [4.3 Regression] ice for legal code with -O3

2007-08-19 Thread pinskia at gcc dot gnu dot org


--- Comment #15 from pinskia at gcc dot gnu dot org  2007-08-19 19:19 
---
Testing a slight modifed version of the patch.


-- 


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



[Bug libfortran/30162] I/O with named pipes does not work

2007-08-19 Thread jvdelisle at gcc dot gnu dot org


--- Comment #21 from jvdelisle at gcc dot gnu dot org  2007-08-19 19:45 
---
This works on 4.2 and 4.3.  Not planning to backport to 4.1.  See if you can
get a later version of gfortran.  If you have problems doing so, check the
gfortran wiki binaries.  If that fails, let me know.


-- 

jvdelisle at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WONTFIX


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



[Bug target/33115] New: -march=native is not supported under x86 darwin

2007-08-19 Thread pinskia at gcc dot gnu dot org
Mentioned here:
http://gcc.gnu.org/ml/gcc-help/2007-08/msg00200.html

And I tested it to make sure it was still not supported:
[andrew-pinskis-computer:~] apinski% ~/local-gcc/bin/gcc -march=native t.c -O2
-o - -S
t.c:1: error: bad value (native) for -march= switch
t.c:1: error: bad value (native) for -mtune= switch
[andrew-pinskis-computer:~] apinski% uname -a
Darwin andrew-pinskis-computer.local 8.10.1 Darwin Kernel Version 8.10.1: Wed
May 23 16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386 i386 i386


-- 
   Summary: -march=native is not supported under x86 darwin
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
 GCC build triplet: i386-apple-darwin8.10
  GCC host triplet: i386-apple-darwin8.10
GCC target triplet: i386-apple-darwin8.10


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



[Bug middle-end/33029] [4.3 Regression] libgcc2.c:1890: internal compiler error: in local_cprop_pass, at gcse.c:3236

2007-08-19 Thread andreast at gcc dot gnu dot org


--- Comment #8 from andreast at gcc dot gnu dot org  2007-08-19 19:56 
---
I can confirm the patch in comment 7 fixes the bootstrap failure here.
Thanks!


-- 

andreast at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||andreast at gcc dot gnu dot
   ||org


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



[Bug tree-optimization/33113] Failing to represent the stride (with array) of a dataref when it is not a constant

2007-08-19 Thread rakdver at gcc dot gnu dot org


--- Comment #1 from rakdver at gcc dot gnu dot org  2007-08-19 20:08 ---
(In reply to comment #0)
 In the following testcase:
 
 subroutine sub(aa,bb,n,m)
   implicit none
   integer, intent(in) :: n,m
   real, intent(inout) :: aa(n,m)
   real, intent(in):: bb(n,m)
   integer :: i,j
  do i = 1,m
 do j= 2,n
   aa(i,j)= aa(i,j-1)+bb(i,j-1)
 enddo
   enddo
 end subroutine
 end
 
 The stride of the accesses in the inner-loop is a parameter (m is not a
 compile-time known constant). As a result the data dataref analyzer reports:
 
 failed: evolution of offset is not affine
 ...
 base_address:
 offset from base address:
 constant offset from base address:
 step:
 aligned to:
 base_object: (*aa_54(D))[0]
 symbol tag: SMT.25
 
 
 Any chance that the dataref analysis can return an (invariant) expression in
 step, so that further analysis could continue? (for example, the access in
 the outer-loop is consecutive, so if we had an expression to represent the
 inner-loop stride, we could vectorize the outer-loop).

Making us return symbolic stride would not be hard.  The problem is that data
dependence analysis would fail anyway, since we cannot tell whether n is zero.


-- 


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



[Bug fortran/33116] New: External functions can be called as subroutine

2007-08-19 Thread burnus at gcc dot gnu dot org
If one uses
  EXTERNAL foo ! or PROCEDURE() :: foo
foo might be either function or a subroutine. However, using
  REAL :: foo
  EXTERNAL foo ! or: PROCEDURE(REAL) :: foo
foo is a function. However, gfortran happily allows the following:

EXTERNAL foo
REAL foo
CALL foo() ! - wrong

NAG f95 diagnoses:
FOO has been declared as a function, not a subroutine

ifort:
The CALL statement is invoking a function subprogram as a subroutine.

g95:
Error: SUBROUTINE 'foo' at (1) cannot have REAL type


-- 
   Summary: External functions can be called as subroutine
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Keywords: accepts-invalid
  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=33116



[Bug fortran/33117] New: Improve error message for generic interface with subroutines functions

2007-08-19 Thread burnus at gcc dot gnu dot org
Mixing functions and subroutines in a generic interface is invalid. gfortran
detects this but the error message is difficult to understand:

Error: FUNCTION at (1) does not belong in a generic subroutine interface

NAG f95:
Error: b.f90, line 10: BAR and SUB must both be SUBROUTINEs or both be
FUNCTIONs for generic GEN

g95:
Error: Interfaces of generic 'gen' at (1) must all be FUNCTIONs or SUBROUTINEs

ifort -stand f95:
fortcom: Warning: b.f90, line 6: Standard Fortran requires that within a
scoping unit, two procedures that have the same generic name shall both be
subroutines or both be functions.   [BAR]

Example:

module mod
  implicit none
  interface gen
subroutine sub()
end subroutine sub
function bar()
  real :: bar
end function bar
  end interface gen
end module mod


-- 
   Summary: Improve error message for generic interface with
subroutines  functions
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Keywords: diagnostic
  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=33117



[Bug target/33115] -march=native is not supported under x86 darwin

2007-08-19 Thread dje at gcc dot gnu dot org


--- Comment #1 from dje at gcc dot gnu dot org  2007-08-19 21:12 ---
x86 darwin should be able to re-use the implementation from
rs6000/driver-rs6000.c because the kernel interfaces to query the information
are the same.


-- 

dje at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||dje at gcc dot gnu dot org


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



[Bug target/33115] -march=native is not supported under x86 darwin

2007-08-19 Thread pinskia at gmail dot com


--- Comment #2 from pinskia at gmail dot com  2007-08-19 21:39 ---
Subject: Re:  -march=native is not supported under x86 darwin

On 19 Aug 2007 21:12:22 -, dje at gcc dot gnu dot org
[EMAIL PROTECTED] wrote:
 x86 darwin should be able to re-use the implementation from
 rs6000/driver-rs6000.c because the kernel interfaces to query the information
 are the same.

Well and i386/driver-i386.c uses inline-asm so it should able to use that also.
EXTRA_GCC_OBJS =driver-i386.o darwin-driver.o
We are able to compile driver-i386.c but just not use it.

The problem is that CC1_SPEC does not use %(cc1_cpu).

Thanks,
Andrew Pinski


-- 


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



[Bug target/33115] -march=native is not supported under x86 darwin

2007-08-19 Thread pinskia at gcc dot gnu dot org


--- Comment #3 from pinskia at gcc dot gnu dot org  2007-08-19 21:40 ---
Mine as explained in comment #2 in how to fix this issue.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2007-08-19 21:40:38
   date||


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



[Bug c/33111] Bad code generation with -O2 (ARM 7 architecture)

2007-08-19 Thread gressau at optusnet dot com dot au


--- Comment #3 from gressau at optusnet dot com dot au  2007-08-19 22:22 
---
Created an attachment (id=14077)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14077action=view)
This file does not compile correctly with -O2


-- 


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



[Bug c/33111] Bad code generation with -O2 (ARM 7 architecture)

2007-08-19 Thread gressau at optusnet dot com dot au


--- Comment #4 from gressau at optusnet dot com dot au  2007-08-19 22:24 
---
Created an attachment (id=14078)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14078action=view)
This is the working unoptimized assembly of uip.c


-- 


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



[Bug c/33111] Bad code generation with -O2 (ARM 7 architecture)

2007-08-19 Thread gressau at optusnet dot com dot au


--- Comment #5 from gressau at optusnet dot com dot au  2007-08-19 22:25 
---
Created an attachment (id=14079)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14079action=view)
This is the nonworking optimized assembly of uip.c


-- 


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



[Bug target/33115] -march=native is not supported under x86 darwin

2007-08-19 Thread pinskia at gcc dot gnu dot org


--- Comment #4 from pinskia at gcc dot gnu dot org  2007-08-19 23:18 ---
Patch in testing:
Index: config/i386/darwin.h
===
--- config/i386/darwin.h(revision 127626)
+++ config/i386/darwin.h(working copy)
@@ -89,7 +89,7 @@ along with GCC; see the file COPYING3.  
the kernel or some such.  */

 #undef CC1_SPEC
-#define CC1_SPEC %{!mkernel:%{!static:%{!mdynamic-no-pic:-fPIC}}} \
+#define CC1_SPEC %(cc1_cpu)%{!mkernel:%{!static:%{!mdynamic-no-pic:-fPIC}}} \
   %{!mmacosx-version-min=*:-mmacosx-version-min=%(darwin_minversion)} \
   %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols
}}



-- 


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



[Bug tree-optimization/32772] [4.3 Regression] error: found real variable when subvariables should have appeared

2007-08-19 Thread dberlin at gcc dot gnu dot org


--- Comment #8 from dberlin at gcc dot gnu dot org  2007-08-19 23:23 ---
Subject: Bug 32772

Author: dberlin
Date: Sun Aug 19 23:23:29 2007
New Revision: 127629

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=127629
Log:
2007-08-19  Daniel Berlin  [EMAIL PROTECTED]

Fix PR 32772
Fix PR 32716
Fix PR 32328
Fix PR 32303

* tree-flow.h (struct stmt_ann_d): Remove makes_clobbering_call.
* tree-ssa-alias.c (init_transitive_clobber_worklist): Add
on_worklist argument and avoid adding things to worklist multiple
times.
(add_to_worklist): Ditto.
(mark_aliases_call_clobbered): Mark entire structure clobbered if
single SFT is clobbered.
(set_initial_properties): Ditto.
(compute_call_clobbered): Update for changes to function
arguments.
(create_overlap_variables_for): Always create SFT for offset 0.
(create_structure_vars): Handle PHI's, since we are in SSA form at
this point.
* tree-ssa-loop-ivopts.c (get_ref_tag): Don't return subvars.
* tree-ssa-operands.c (access_can_touch_variable): Don't handle
TARGET_MEM_REF.
(add_vars_for_offset): Figure out aliases from access + points-to.
(add_virtual_operand): Use add_vars-for_offset.
(get_tmr_operands): Update for NMT changes, rewrite to be correct.
(add_call_clobber_ops): Remove makes_clobbering_call set.
(get_expr_operands): Always pass through the INDIRECT_REF
reference.
* tree-ssa-structalias.c (struct constraint_graph): Remove
variables member.
Add pe, pe_rep, pointer_label, loc_label, pointed_by, points_to,
address_taken, pt_used, number_incoming.
(FIRST_ADDR_NODE): Removed.
(merge_graph_nodes): Remove broken code for the moment.
(init_graph): New function.
(build_pred_graph): Remove code to init_graph.
Add location equivalence support.
(struct scc_info): Rename roots to deleted.
(scc_visit): Ditto.
(init_scc_info): Ditto
(init_topo_info): Use graph-size.
(compute_topo_order): Ditto.
(do_da_constraint): Removed.
(do_sd_constraint): Remove calls to find().
set_union_with_increment should always get 0 as last arg here.
(do_complex_constraint): Replace do_da_constraint with assert.
Stop calling find.
(struct equiv_class_label): New.
(pointer_equiv_class_table): Ditto.
(location_equiv_class_table): Ditto.
(equiv_class_label_hash): Ditto.
(equiv_class_label_eq): Ditto
(equiv_class_lookup): Ditto.
(equiv_class_ladd): Ditto.
(pointer_equiv_class): Ditto.
(location_equiv_class): Ditto.
(condense_visit): Rename and rewrite from label_visit to do only
SCC related stuff for HU.
(label_visit): Do HU work for HU.
(perform_var_substitution): Update to do HU and location
equivalence.
(free_var_substitution_info): Update to free HU and location
equivalence structures.  */
(find_equivalent_node): Update for pointer but not location
equivalence.
(unite_pointer_equivalences): New function.
(move_complex_constraints): Rewrite to only do moving.
(rewrite_constraints): Split out of move_complex_constraints.
(solve_graph): Use graph-size.
(process_constraint_1): Add from_call argument, use it.
Split *a = b into two constraints.
(process_constraint): Use new process_constraint_1.
(get_constraint_for_component_ref): Handle bitmaxsize == -1 case.
(get_constraint_for): Handle non-pointer integers properly.
Remove code that used to handle structures.
(handle_ptr_arith): Fix a few bugs in pointer arithmetic handling
with unknown addends.
(handle_rhs_call): New function.
(find_func_aliases): Use handle_rhs_call.
(set_uids_in_ptset): Add an assert.
(set_used_smts): Fix bug in not considering unified vars.
(compute_tbaa_pruning): Stop initing useless iteration_obstack.
(compute_points_to_sets): Update for other function changes.
(delete_points_to_sets): Ditto.
(ipa_pta_execute): Ditto.
(pass_ipa_pta): We need to update SSA after ipa_pta.



Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-flow.h
trunk/gcc/tree-ssa-alias.c
trunk/gcc/tree-ssa-loop-ivopts.c
trunk/gcc/tree-ssa-operands.c
trunk/gcc/tree-ssa-structalias.c


-- 


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



[Bug tree-optimization/32303] [4.3 Regression] SPEC2006 447.dealII miscompiled at -O2

2007-08-19 Thread dberlin at gcc dot gnu dot org


--- Comment #2 from dberlin at gcc dot gnu dot org  2007-08-19 23:23 ---
Subject: Bug 32303

Author: dberlin
Date: Sun Aug 19 23:23:29 2007
New Revision: 127629

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=127629
Log:
2007-08-19  Daniel Berlin  [EMAIL PROTECTED]

Fix PR 32772
Fix PR 32716
Fix PR 32328
Fix PR 32303

* tree-flow.h (struct stmt_ann_d): Remove makes_clobbering_call.
* tree-ssa-alias.c (init_transitive_clobber_worklist): Add
on_worklist argument and avoid adding things to worklist multiple
times.
(add_to_worklist): Ditto.
(mark_aliases_call_clobbered): Mark entire structure clobbered if
single SFT is clobbered.
(set_initial_properties): Ditto.
(compute_call_clobbered): Update for changes to function
arguments.
(create_overlap_variables_for): Always create SFT for offset 0.
(create_structure_vars): Handle PHI's, since we are in SSA form at
this point.
* tree-ssa-loop-ivopts.c (get_ref_tag): Don't return subvars.
* tree-ssa-operands.c (access_can_touch_variable): Don't handle
TARGET_MEM_REF.
(add_vars_for_offset): Figure out aliases from access + points-to.
(add_virtual_operand): Use add_vars-for_offset.
(get_tmr_operands): Update for NMT changes, rewrite to be correct.
(add_call_clobber_ops): Remove makes_clobbering_call set.
(get_expr_operands): Always pass through the INDIRECT_REF
reference.
* tree-ssa-structalias.c (struct constraint_graph): Remove
variables member.
Add pe, pe_rep, pointer_label, loc_label, pointed_by, points_to,
address_taken, pt_used, number_incoming.
(FIRST_ADDR_NODE): Removed.
(merge_graph_nodes): Remove broken code for the moment.
(init_graph): New function.
(build_pred_graph): Remove code to init_graph.
Add location equivalence support.
(struct scc_info): Rename roots to deleted.
(scc_visit): Ditto.
(init_scc_info): Ditto
(init_topo_info): Use graph-size.
(compute_topo_order): Ditto.
(do_da_constraint): Removed.
(do_sd_constraint): Remove calls to find().
set_union_with_increment should always get 0 as last arg here.
(do_complex_constraint): Replace do_da_constraint with assert.
Stop calling find.
(struct equiv_class_label): New.
(pointer_equiv_class_table): Ditto.
(location_equiv_class_table): Ditto.
(equiv_class_label_hash): Ditto.
(equiv_class_label_eq): Ditto
(equiv_class_lookup): Ditto.
(equiv_class_ladd): Ditto.
(pointer_equiv_class): Ditto.
(location_equiv_class): Ditto.
(condense_visit): Rename and rewrite from label_visit to do only
SCC related stuff for HU.
(label_visit): Do HU work for HU.
(perform_var_substitution): Update to do HU and location
equivalence.
(free_var_substitution_info): Update to free HU and location
equivalence structures.  */
(find_equivalent_node): Update for pointer but not location
equivalence.
(unite_pointer_equivalences): New function.
(move_complex_constraints): Rewrite to only do moving.
(rewrite_constraints): Split out of move_complex_constraints.
(solve_graph): Use graph-size.
(process_constraint_1): Add from_call argument, use it.
Split *a = b into two constraints.
(process_constraint): Use new process_constraint_1.
(get_constraint_for_component_ref): Handle bitmaxsize == -1 case.
(get_constraint_for): Handle non-pointer integers properly.
Remove code that used to handle structures.
(handle_ptr_arith): Fix a few bugs in pointer arithmetic handling
with unknown addends.
(handle_rhs_call): New function.
(find_func_aliases): Use handle_rhs_call.
(set_uids_in_ptset): Add an assert.
(set_used_smts): Fix bug in not considering unified vars.
(compute_tbaa_pruning): Stop initing useless iteration_obstack.
(compute_points_to_sets): Update for other function changes.
(delete_points_to_sets): Ditto.
(ipa_pta_execute): Ditto.
(pass_ipa_pta): We need to update SSA after ipa_pta.



Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-flow.h
trunk/gcc/tree-ssa-alias.c
trunk/gcc/tree-ssa-loop-ivopts.c
trunk/gcc/tree-ssa-operands.c
trunk/gcc/tree-ssa-structalias.c


-- 


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



[Bug tree-optimization/32328] [4.2/4.3 Regression] -fstrict-aliasing causes skipped code

2007-08-19 Thread dberlin at gcc dot gnu dot org


--- Comment #21 from dberlin at gcc dot gnu dot org  2007-08-19 23:23 
---
Subject: Bug 32328

Author: dberlin
Date: Sun Aug 19 23:23:29 2007
New Revision: 127629

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=127629
Log:
2007-08-19  Daniel Berlin  [EMAIL PROTECTED]

Fix PR 32772
Fix PR 32716
Fix PR 32328
Fix PR 32303

* tree-flow.h (struct stmt_ann_d): Remove makes_clobbering_call.
* tree-ssa-alias.c (init_transitive_clobber_worklist): Add
on_worklist argument and avoid adding things to worklist multiple
times.
(add_to_worklist): Ditto.
(mark_aliases_call_clobbered): Mark entire structure clobbered if
single SFT is clobbered.
(set_initial_properties): Ditto.
(compute_call_clobbered): Update for changes to function
arguments.
(create_overlap_variables_for): Always create SFT for offset 0.
(create_structure_vars): Handle PHI's, since we are in SSA form at
this point.
* tree-ssa-loop-ivopts.c (get_ref_tag): Don't return subvars.
* tree-ssa-operands.c (access_can_touch_variable): Don't handle
TARGET_MEM_REF.
(add_vars_for_offset): Figure out aliases from access + points-to.
(add_virtual_operand): Use add_vars-for_offset.
(get_tmr_operands): Update for NMT changes, rewrite to be correct.
(add_call_clobber_ops): Remove makes_clobbering_call set.
(get_expr_operands): Always pass through the INDIRECT_REF
reference.
* tree-ssa-structalias.c (struct constraint_graph): Remove
variables member.
Add pe, pe_rep, pointer_label, loc_label, pointed_by, points_to,
address_taken, pt_used, number_incoming.
(FIRST_ADDR_NODE): Removed.
(merge_graph_nodes): Remove broken code for the moment.
(init_graph): New function.
(build_pred_graph): Remove code to init_graph.
Add location equivalence support.
(struct scc_info): Rename roots to deleted.
(scc_visit): Ditto.
(init_scc_info): Ditto
(init_topo_info): Use graph-size.
(compute_topo_order): Ditto.
(do_da_constraint): Removed.
(do_sd_constraint): Remove calls to find().
set_union_with_increment should always get 0 as last arg here.
(do_complex_constraint): Replace do_da_constraint with assert.
Stop calling find.
(struct equiv_class_label): New.
(pointer_equiv_class_table): Ditto.
(location_equiv_class_table): Ditto.
(equiv_class_label_hash): Ditto.
(equiv_class_label_eq): Ditto
(equiv_class_lookup): Ditto.
(equiv_class_ladd): Ditto.
(pointer_equiv_class): Ditto.
(location_equiv_class): Ditto.
(condense_visit): Rename and rewrite from label_visit to do only
SCC related stuff for HU.
(label_visit): Do HU work for HU.
(perform_var_substitution): Update to do HU and location
equivalence.
(free_var_substitution_info): Update to free HU and location
equivalence structures.  */
(find_equivalent_node): Update for pointer but not location
equivalence.
(unite_pointer_equivalences): New function.
(move_complex_constraints): Rewrite to only do moving.
(rewrite_constraints): Split out of move_complex_constraints.
(solve_graph): Use graph-size.
(process_constraint_1): Add from_call argument, use it.
Split *a = b into two constraints.
(process_constraint): Use new process_constraint_1.
(get_constraint_for_component_ref): Handle bitmaxsize == -1 case.
(get_constraint_for): Handle non-pointer integers properly.
Remove code that used to handle structures.
(handle_ptr_arith): Fix a few bugs in pointer arithmetic handling
with unknown addends.
(handle_rhs_call): New function.
(find_func_aliases): Use handle_rhs_call.
(set_uids_in_ptset): Add an assert.
(set_used_smts): Fix bug in not considering unified vars.
(compute_tbaa_pruning): Stop initing useless iteration_obstack.
(compute_points_to_sets): Update for other function changes.
(delete_points_to_sets): Ditto.
(ipa_pta_execute): Ditto.
(pass_ipa_pta): We need to update SSA after ipa_pta.



Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-flow.h
trunk/gcc/tree-ssa-alias.c
trunk/gcc/tree-ssa-loop-ivopts.c
trunk/gcc/tree-ssa-operands.c
trunk/gcc/tree-ssa-structalias.c


-- 


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



[Bug c++/32716] [4.2/4.3 Regression] Wrong code generation. Alias and C++ virtual bases problem.

2007-08-19 Thread dberlin at gcc dot gnu dot org


--- Comment #8 from dberlin at gcc dot gnu dot org  2007-08-19 23:23 ---
Subject: Bug 32716

Author: dberlin
Date: Sun Aug 19 23:23:29 2007
New Revision: 127629

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=127629
Log:
2007-08-19  Daniel Berlin  [EMAIL PROTECTED]

Fix PR 32772
Fix PR 32716
Fix PR 32328
Fix PR 32303

* tree-flow.h (struct stmt_ann_d): Remove makes_clobbering_call.
* tree-ssa-alias.c (init_transitive_clobber_worklist): Add
on_worklist argument and avoid adding things to worklist multiple
times.
(add_to_worklist): Ditto.
(mark_aliases_call_clobbered): Mark entire structure clobbered if
single SFT is clobbered.
(set_initial_properties): Ditto.
(compute_call_clobbered): Update for changes to function
arguments.
(create_overlap_variables_for): Always create SFT for offset 0.
(create_structure_vars): Handle PHI's, since we are in SSA form at
this point.
* tree-ssa-loop-ivopts.c (get_ref_tag): Don't return subvars.
* tree-ssa-operands.c (access_can_touch_variable): Don't handle
TARGET_MEM_REF.
(add_vars_for_offset): Figure out aliases from access + points-to.
(add_virtual_operand): Use add_vars-for_offset.
(get_tmr_operands): Update for NMT changes, rewrite to be correct.
(add_call_clobber_ops): Remove makes_clobbering_call set.
(get_expr_operands): Always pass through the INDIRECT_REF
reference.
* tree-ssa-structalias.c (struct constraint_graph): Remove
variables member.
Add pe, pe_rep, pointer_label, loc_label, pointed_by, points_to,
address_taken, pt_used, number_incoming.
(FIRST_ADDR_NODE): Removed.
(merge_graph_nodes): Remove broken code for the moment.
(init_graph): New function.
(build_pred_graph): Remove code to init_graph.
Add location equivalence support.
(struct scc_info): Rename roots to deleted.
(scc_visit): Ditto.
(init_scc_info): Ditto
(init_topo_info): Use graph-size.
(compute_topo_order): Ditto.
(do_da_constraint): Removed.
(do_sd_constraint): Remove calls to find().
set_union_with_increment should always get 0 as last arg here.
(do_complex_constraint): Replace do_da_constraint with assert.
Stop calling find.
(struct equiv_class_label): New.
(pointer_equiv_class_table): Ditto.
(location_equiv_class_table): Ditto.
(equiv_class_label_hash): Ditto.
(equiv_class_label_eq): Ditto
(equiv_class_lookup): Ditto.
(equiv_class_ladd): Ditto.
(pointer_equiv_class): Ditto.
(location_equiv_class): Ditto.
(condense_visit): Rename and rewrite from label_visit to do only
SCC related stuff for HU.
(label_visit): Do HU work for HU.
(perform_var_substitution): Update to do HU and location
equivalence.
(free_var_substitution_info): Update to free HU and location
equivalence structures.  */
(find_equivalent_node): Update for pointer but not location
equivalence.
(unite_pointer_equivalences): New function.
(move_complex_constraints): Rewrite to only do moving.
(rewrite_constraints): Split out of move_complex_constraints.
(solve_graph): Use graph-size.
(process_constraint_1): Add from_call argument, use it.
Split *a = b into two constraints.
(process_constraint): Use new process_constraint_1.
(get_constraint_for_component_ref): Handle bitmaxsize == -1 case.
(get_constraint_for): Handle non-pointer integers properly.
Remove code that used to handle structures.
(handle_ptr_arith): Fix a few bugs in pointer arithmetic handling
with unknown addends.
(handle_rhs_call): New function.
(find_func_aliases): Use handle_rhs_call.
(set_uids_in_ptset): Add an assert.
(set_used_smts): Fix bug in not considering unified vars.
(compute_tbaa_pruning): Stop initing useless iteration_obstack.
(compute_points_to_sets): Update for other function changes.
(delete_points_to_sets): Ditto.
(ipa_pta_execute): Ditto.
(pass_ipa_pta): We need to update SSA after ipa_pta.



Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-flow.h
trunk/gcc/tree-ssa-alias.c
trunk/gcc/tree-ssa-loop-ivopts.c
trunk/gcc/tree-ssa-operands.c
trunk/gcc/tree-ssa-structalias.c


-- 


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



[Bug middle-end/32940] REG_POINTER attribute on DECL_ARTIFICIAL pointers

2007-08-19 Thread pinskia at gcc dot gnu dot org


--- Comment #7 from pinskia at gcc dot gnu dot org  2007-08-20 00:48 ---
Subject: Bug 32940

Author: pinskia
Date: Mon Aug 20 00:48:09 2007
New Revision: 127634

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=127634
Log:
2007-08-19  Andrew Pinski  [EMAIL PROTECTED]

PR middle-end/32940
* cfgexpand.c  (expand_one_register_var): Mark pointer
DECL_ARTIFICIAL as REG_POINTER also.
* stmt.c (expand_decl): Likewise.



Modified:
trunk/gcc/ChangeLog
trunk/gcc/cfgexpand.c
trunk/gcc/stmt.c


-- 


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



[Bug middle-end/32940] REG_POINTER attribute on DECL_ARTIFICIAL pointers

2007-08-19 Thread pinskia at gcc dot gnu dot org


--- Comment #8 from pinskia at gcc dot gnu dot org  2007-08-20 00:48 ---
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

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


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



[Bug testsuite/31884] priority_queue_dijkstra.cc operates on deallocated memory

2007-08-19 Thread pinskia at gcc dot gnu dot org


--- Comment #3 from pinskia at gcc dot gnu dot org  2007-08-20 00:56 ---
This test now works for me on i386-apple-darwin, it was failing before this
patch.
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

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


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



[Bug middle-end/33092] [4.3 Regrsssion] Using -O1 -fno-tree-salias results in ICE

2007-08-19 Thread pinskia at gcc dot gnu dot org


--- Comment #2 from pinskia at gcc dot gnu dot org  2007-08-20 01:46 ---
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2007-08-20 01:46:26
   date||


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



[Bug tree-optimization/32328] [4.2/4.3 Regression] -fstrict-aliasing causes skipped code

2007-08-19 Thread dberlin at gcc dot gnu dot org


--- Comment #22 from dberlin at gcc dot gnu dot org  2007-08-20 01:54 
---
All should be fixed


-- 

dberlin at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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



[Bug tree-optimization/32303] [4.3 Regression] SPEC2006 447.dealII miscompiled at -O2

2007-08-19 Thread dberlin at gcc dot gnu dot org


--- Comment #3 from dberlin at gcc dot gnu dot org  2007-08-20 01:54 ---
All should be fixed


-- 

dberlin at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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



[Bug tree-optimization/32772] [4.3 Regression] error: found real variable when subvariables should have appeared

2007-08-19 Thread dberlin at gcc dot gnu dot org


--- Comment #9 from dberlin at gcc dot gnu dot org  2007-08-20 01:54 ---
All should be fixed


-- 

dberlin at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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



[Bug c++/32716] [4.2/4.3 Regression] Wrong code generation. Alias and C++ virtual bases problem.

2007-08-19 Thread dberlin at gcc dot gnu dot org


--- Comment #9 from dberlin at gcc dot gnu dot org  2007-08-20 01:54 ---
All should be fixed


-- 

dberlin at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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



[Bug tree-optimization/32723] [4.2 Regression] memory hog in solve_graph

2007-08-19 Thread dberlin at gcc dot gnu dot org


--- Comment #11 from dberlin at gcc dot gnu dot org  2007-08-20 01:56 
---
Uh, it doesn't take 1 gig on either 4.2 or 4.3


-- 


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



[Bug c++/33118] New: [4.3 Regression] #'argument_pack_select' not supported by dump_expr#expression error

2007-08-19 Thread pinskia at gcc dot gnu dot org
Testcase:
template typename _Tp
struct __add_const_lvalue_reference;
templatetypename... _Elements
class tuple
{
  tuple(typename __add_const_lvalue_reference_Elements::type ...) ;
};
tupleint, int, int i;

- CUT -
Found while cutting down PR 33091.  This is a regression because the error
message was ok in 4.2.0 and before.
On the trunk we get:
t.cc: In instantiation of 'tuple#'argument_pack_select' not supported by
dump_expr#expression error ':
t.cc:8:   instantiated from here
t.cc:6: error: invalid use of incomplete type 'struct
__add_const_lvalue_referenceint'


-- 
   Summary: [4.3 Regression] #'argument_pack_select' not supported
by dump_expr#expression error
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Keywords: diagnostic
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org


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



[Bug c++/33118] [4.3 Regression] #'argument_pack_select' not supported by dump_expr#expression error

2007-08-19 Thread pinskia at gcc dot gnu dot org


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|--- |4.3.0


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



[Bug fortran/20896] [4.2 and 4.1 only] ambiguous interface not detected

2007-08-19 Thread pault at gcc dot gnu dot org


--- Comment #10 from pault at gcc dot gnu dot org  2007-08-20 03:48 ---
(In reply to comment #9)
 (In reply to comment #8)
  Paul, what is the status on this one?
 
 ping?
 
Go back to the thread on it.  I did not seem able to satisfy the reviewer as to
my interpretation of the standard; since I could not see any other, I let it
drop. I'll unassign myself.

Paul


-- 

pault at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|pault at gcc dot gnu dot org|unassigned at gcc dot gnu
   ||dot org
 Status|ASSIGNED|NEW


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



[Bug fortran/33116] External functions can be called as subroutine

2007-08-19 Thread pault at gcc dot gnu dot org


--- Comment #1 from pault at gcc dot gnu dot org  2007-08-20 03:59 ---
Tobias,

  EXTERNAL foo
  REAL foo
  CALL foo() ! - wrong
END

with 4.3.0 20070815, gfc gives:

test.f90:1.14:

  EXTERNAL foo
 1
test.f90:3.23:

  CALL foo() ! - wrong
  2
Error: 'foo' at (1) has a type, which is not consistent with the CALL at (2)


-- 


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



[Bug target/33115] -march=native is not supported under x86 darwin

2007-08-19 Thread pinskia at gcc dot gnu dot org


--- Comment #5 from pinskia at gcc dot gnu dot org  2007-08-20 05:16 ---
Subject: Bug 33115

Author: pinskia
Date: Mon Aug 20 05:16:10 2007
New Revision: 127635

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=127635
Log:
2007-08-19  Andrew Pinski  [EMAIL PROTECTED]

PR target/33115
* config/i386/darwin.h (CC1_SPEC): Add %(cc1_cpu) in front.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/darwin.h


-- 


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



[Bug target/33115] -march=native is not supported under x86 darwin

2007-08-19 Thread pinskia at gcc dot gnu dot org


--- Comment #6 from pinskia at gcc dot gnu dot org  2007-08-20 05:30 ---
Fixed (I added a space after %(cc1_cpu) for the final patch).


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

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


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



[Bug tree-optimization/33113] Failing to represent the stride (with array) of a dataref when it is not a constant

2007-08-19 Thread dorit at gcc dot gnu dot org


--- Comment #2 from dorit at gcc dot gnu dot org  2007-08-20 05:55 ---
 Making us return symbolic stride would not be hard.  The problem is that data
 dependence analysis would fail anyway, 

sometimes (not in this testcases) there won't be a need for dependence testing
- e.g. a reduction computation where there are no stores, or initialization
with a constant (i.e. a store and no loads), so there's already a value in
doing this.

 since we cannot tell whether n is zero.

can we do the data-dependence analysis conditioned on a maybe_zero (like the
number-of-iterations analysis)? (by the way, I was told that ifort vectorizes
this. I think we'd need loop reversal to vectorize the inner-loop though. on
top of overcoming the unknown-stride issue in the DR and DDR analysis)


-- 


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