Skip to content
Snippets Groups Projects
Commit 4e1d7042 authored by Torbjörn SVENSSON's avatar Torbjörn SVENSSON
Browse files

IRA: Make sure array is big enough


In commit 081c9662, the call to resize_reg_info() was moved before
the call to remove_scratches() and the latter one can increase the
number of regs and that would cause an out of bounds usage on the
reg_renumber global array.

Without this patch, the following testcase randomly fails with:
during RTL pass: ira
In file included from /src/gcc/testsuite/gcc.dg/compat/struct-by-value-5b_y.c:13:
/src/gcc/testsuite/gcc.dg/compat/struct-by-value-5b_y.c: In function 'checkgSf13':
/src/gcc/testsuite/gcc.dg/compat/fp-struct-test-by-value-y.h:28:1: internal compiler error: Segmentation fault
/src/gcc/testsuite/gcc.dg/compat/struct-by-value-5b_y.c:22:1: note: in expansion of macro 'TEST'

gcc/ChangeLog:

	* ira.cc: Resize array after reg number increased.

Co-Authored-By: default avatarYvan ROUX <yvan.roux@foss.st.com>
Signed-off-by: default avatarTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
parent 27065374
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment