This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/41630] [4.3/4.4 Regression] Optimization error on vectors of uint64_t



------- Comment #8 from joseph at codesourcery dot com  2010-03-15 15:17 -------
Subject: Re:  [4.3/4.4 Regression] Optimization error on vectors
 of uint64_t

On Mon, 15 Mar 2010, rguenth at gcc dot gnu dot org wrote:

> Joseph, is this a valid testcase?
> 
> typedef unsigned long obj[1];
> extern void abort (void);
> int main()
> {
>     obj X[2];
>     X[1][0] = 67890;
>     if (X[0][1] != 67890)

This access to X[0][1] looks like an out-of-bounds access that is 
undefined behavior like the example in Annex J: "An array subscript is out 
of range, even if an object is apparently accessible with the given 
subscript (as in the lvalue expression a[1][7] given the declaration int 
a[4][5]) (6.5.6).".  (This originates in C90 DR#017; the example was added 
in C90 TC1.)


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]