[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Bug tree-optimization/42703] [4.5 Regression] ICE in generate_subtree_copies with out of bounds array access




------- Comment #5 from jamborm at gcc dot gnu dot org  2010-01-12 21:05 -------
I would say that the dd.c[4] access into an array that is four chars
long has undefined behavior.  It is also the reason why
build_ref_for_offset cannot find a suitable array element for it,
because there is none.

Because we should not ICE anyway I guess I'll resort to pro-actively
checking that we can create an access to the original piece of the
aggregate when deciding what replacements to create.  (That is a bit
pity as the asserts nicely checked that the function worked in the
cases when it really should.)

Another option (as Andrew has just suggested on IRC) would be to turn
such things into __builtin_trap().  That would teach them not to write
code like this, <evil grin>.


-- 

jamborm at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2010-01-12 14:13:18         |2010-01-12 21:05:19
               date|                            |


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Reply to: