On 9/28/25 8:54 AM, Andrew Pinski wrote:


On Sun, Sep 28, 2025, 7:55 AM Andrew Pinski <[email protected] <mailto:[email protected]>> wrote:



    On Sun, Sep 28, 2025, 7:30 AM YunQiang Su <[email protected]
    <mailto:[email protected]>> wrote:

        Richard Biener <[email protected]
        <mailto:[email protected]>> 于2025年9月24日周三 20:36写道:
         >
         > On Tue, Sep 23, 2025 at 5:56 AM Andrew Pinski
         > <[email protected]
        <mailto:[email protected]>> wrote:
         > >
         > > This is the next patch in the series of removing fab.
         > > This one is simplier than builtin_constant_p because the only
         > > time we want to simplify this builtin is at the final
        folding step.
         > >
         > > Note align-5.c needs to change slightly as
        __builtin_assume_aligned
         > > is no longer taken into account for the same reason as why
        PR 111875
         > > is closed as invalid and why the testcase is failing at -Og
         > > I added a new testcase align-5a.c where the pointer is
        explictly aligned
         > > so that the check is gone there.
         > > Note __builtin_assume_aligned should really be instrumented
        for UBSAN,
         > > I filed PR 122038 for that.
         > >
         > > Bootstrapped and tested on x86_64-linux-gnu.
         >

        With this patch, this test case fails on riscv64-linux-gnu
           gcc.target/riscv/cmo-zicboz-zic64-1.c


    Can you file a bug report and i will look into it when I get back
    home from the cauldron?


Ok, I see the issue.
We now lose __builtin_assume_aligned for expand in some cases.
There are two/three ways of fixing this. One is lowering memset and the aligning the access type to the new alignment.

The second way is to prevent forwprop for proping the ssa names from a lower alignment and replacing the higher one.
That would fix -Og once I finish with set of patches.

The 3rd way, when removing __builtin_assume_aligned also mark the original ssa name with the same alignment info if it is only used from the baa.
That means moving this to forwprop only.


Let me think which is the best.
Still catching up as well. I saw a similar failure on sh3[eb]-linux-gnu for:

gcc: gcc.target/sh/cmpstr.c scan-assembler-times tst\t#3 2
gcc: gcc.target/sh/pr67675.c scan-assembler-times or\tr[0-9],r[0-9] 1
gcc: gcc.target/sh/pr67675.c scan-assembler-times tst\t#3,r0 6
gcc: gcc.target/sh/strlen.c scan-assembler-times tst\t#3 1


As I noted in pr111875. Made that note before I got to this thread in my inbox ;-)

jeff

Reply via email to