[Bug rtl-optimization/110791] [12/13/14 Regression] arm: Wrong code with -Os -march=armv8.1-m.main
acoplan at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jul 24 11:27:54 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110791
--- Comment #2 from Alex Coplan <acoplan at gcc dot gnu.org> ---
(In reply to Xi Ruoyao from comment #1)
> Isn't this a UB?
>
> while (p >= path && *p != '/')
> p--;
>
> This will cause p to become "&main::path[0] - 1". C23 6.5.6p9:
In this case, with the input given in main, I think p should end up pointing to
main::path + 1 (since we pass in main::path + 2, and foo can only ever
decrement p at most one below its parameter path).
More information about the Gcc-bugs
mailing list