[Bug middle-end/78174] out of bounds array subscript in rtl.h NOTE_DATA macro

2016-11-04 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78174 Martin Sebor changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug middle-end/78174] out of bounds array subscript in rtl.h NOTE_DATA macro

2016-11-02 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78174 --- Comment #10 from Jakub Jelinek --- Other such spots are in gimple.h (e.g. gimple_statement_with_ops, gimple_statement_with_memory_ops, gcall, gphi, gasm. Most likely we have other spots with that.

[Bug middle-end/78174] out of bounds array subscript in rtl.h NOTE_DATA macro

2016-11-02 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78174 --- Comment #9 from Jakub Jelinek --- No, I've also explained what to do about the u.fld thing. sed -n '/^DEF_RTL_EXPR/{s/DEF_RTL_EXPR([^,]*,[^,]*, "//;s/".*$//;p}' rtl.def | sort -u shows we have at most 8 fields right now, so we could define so

[Bug middle-end/78174] out of bounds array subscript in rtl.h NOTE_DATA macro

2016-11-01 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78174 --- Comment #8 from Martin Sebor --- Okay, thanks. Your comments seem to be focused on my patch and not so much on this problem that was exposed by it. I realize I invited those comments with my response and do want to continue to have that dis

[Bug middle-end/78174] out of bounds array subscript in rtl.h NOTE_DATA macro

2016-11-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78174 --- Comment #7 from Jakub Jelinek --- (In reply to Martin Sebor from comment #6) > (In reply to Jakub Jelinek from comment #5) > > Do you have an explanation of why it's "just incorrect?" or an example where > it results in warning on valid code

[Bug middle-end/78174] out of bounds array subscript in rtl.h NOTE_DATA macro

2016-11-01 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78174 --- Comment #6 from Martin Sebor --- (In reply to Jakub Jelinek from comment #5) Do you have an explanation of why it's "just incorrect?" or an example where it results in warning on valid code? I have found another compiler that issues a warni

[Bug middle-end/78174] out of bounds array subscript in rtl.h NOTE_DATA macro

2016-11-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78174 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #5

[Bug middle-end/78174] out of bounds array subscript in rtl.h NOTE_DATA macro

2016-10-31 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78174 --- Comment #4 from Martin Sebor --- Yes, rtx_note derives from rtx_insn which derives from rtx_def which is where the union containing the one-element fld array is defined.

[Bug middle-end/78174] out of bounds array subscript in rtl.h NOTE_DATA macro

2016-10-31 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78174 --- Comment #3 from Andrew Pinski --- (In reply to Martin Sebor from comment #2) > I realize > that GCC sometimes treats even one element arrays (and even bigger if > they're last) as zero-length even though that's not documented anywhere > (AFA

[Bug middle-end/78174] out of bounds array subscript in rtl.h NOTE_DATA macro

2016-10-31 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78174 --- Comment #2 from Martin Sebor --- The problem can be reduced to the following test case that triggers the warning even with unpatched GCC (and prior releases). $ cat b.c && g++ -O2 -S -Wall b.c struct A { int i, j; }; struct B { int i0, j0, i

[Bug middle-end/78174] out of bounds array subscript in rtl.h NOTE_DATA macro

2016-10-31 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78174 --- Comment #1 from Andrew Pinski --- I think the warning is not called for and here is why. There is no way in both C89 and C++ (in C99 there is) to say the array at the end of a struct (even inside an union) is a variable length. So GCC decid