[Bug c/87944] Wrong code with LRA pushing stack local variable
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87944 Stefan "Bebbo" Franke changed: What|Removed |Added CC||stefan at franke dot ms --- Comment #4 from Stefan "Bebbo" Franke --- the problem resides in lra-eliminations.c. It starts in void eliminate_regs_in_insn where a simple plus bypasses the stack offset handling: /* If we have a nonzero offset, and the source is already a simple REG, the following transformation would increase the cost of the insn by replacing a simple REG with (plus (reg sp) CST). So try only when we already had a PLUS before. */ if (known_eq (offset, 0) || plus_src) because lra_get_insn_recog_data (insn)->sp_offset is not considered. With the m68k architecture plus using lra you get this problem plus some similar ones, all related to arg / frame / stack pointer conversion with incorrect offsets. I fixed it locally with few more changes in lra-elimintaions.c
[Bug c/87944] Wrong code with LRA pushing stack local variable
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87944 --- Comment #3 from kargl at gcc dot gnu.org --- Author: kargl Date: Sun Dec 16 03:33:05 2018 New Revision: 267184 URL: https://gcc.gnu.org/viewcvs?rev=267184=gcc=rev Log: 2018-12-15 Steven G. Kargl PR fortran/87944 * decl.c (match_data_constant): Allow inquiry parameter as data constant in data statement. 2018-12-15 Steven G. Kargl PR fortran/87944 * gfortran.dg/pr87994_1.f90: New test. * gfortran.dg/pr87994_2.f90: Ditto. * gfortran.dg/pr87994_3.f90: Ditto. Added: trunk/gcc/testsuite/gfortran.dg/pr87994_1.f90 trunk/gcc/testsuite/gfortran.dg/pr87994_2.f90 trunk/gcc/testsuite/gfortran.dg/pr87994_3.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/decl.c trunk/gcc/testsuite/ChangeLog
[Bug c/87944] Wrong code with LRA pushing stack local variable
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87944 --- Comment #2 from pkoning at gcc dot gnu.org --- Created attachment 44979 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44979=edit Test program source
[Bug c/87944] Wrong code with LRA pushing stack local variable
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87944 --- Comment #1 from pkoning at gcc dot gnu.org --- Created attachment 44978 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44978=edit Reload dump