This is the mail archive of the gcc-patches@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]

Re: [RFC PATCH, RTL]: Fix PR63348, gcc.dg/pr43670.c fail -fcompare-debug on MIPS


On 09/24/14 13:39, Uros Bizjak wrote:
Hello!

The failure was caused by barrier detection code, which failed to
detect barrier after call insn was to be split when
NOTE_CALL_ARG_LOCATION was present. This problem caused
-fcompare-debug failure.

Digging a bit deeped, and as hinted in the PR, the handling of
barriers in try_split seems to be broken. The code is emitting extra
barrier for non-debug compiles, but it "forgots" to remove the
existing one, leading to duplicated barriers. The barrier is not
detected at all for debug build.

I have removed special handling of barriers here (also, the comment in
removed code was not helpful at all), and this solved -fcompare-debug
failure.

The patch was also bootstrapped and regression tested on
x86_64-linux-gnu {,-m32} which in -m32 mode splits x87 FP jump insns,
and there were no regressions. However, I am not too familiar with
rtl-optimization part and I am not confident that this code surgery is
fully correct, so this is the reason for RFC status of the patch.

2014-09-24  Uros Bizjak  <ubizjak@gmail.com>

     PR rtl-optimization/63348
     * emit-rtl.c (try_split): Do not emit extra barrier.

Patch was bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.
OK, so digging deeper....

I'm pretty sure this code was originally intended to cope with delete_insn removing any barrier which immediately followed a jump insn when the jump insn is removed.

ie, if TRIAL was a JUMP_INSN and it was immediately followed by a BARRIER. Assume we successfully split TRIAL. In that case we call delete_insn (TRIAL). That will in turn remove the BARRIER.

At least that's how things worked in gcc-2.0 ;-)

Walking through a modern try_split, delete_insn and friends, it doesn't look like we'll try to remove the original BARRIER anymore.

I'm comfortable removing this ancient code as I don't believe the original problem that folks were solving with it can occur anymore.

Approved for the trunk.

jeff







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