[Bug rtl-optimization/125728] [16/17 Regression] M68k: m68k-elf-gcc generates code that raises address error exception in certain circumstances

"pinskia at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125728

--- Comment #5 from Drea Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Drea Pinski from comment #4)
> There is code in validate_subreg which is designed to reject some of this
> BUT it looks like misses the issue with big-endian needing a negative offset
> for big-endian which causes the alignment check to be not be good enough:
> 
> ```
>   /* Do not allow normal SUBREG with stricter alignment than the inner MEM.
> 
>      PR120329: Combine can create paradoxical mem subregs even for
>      strict-alignment targets.  Allow it until combine is fixed.  */
>   else if (reg && MEM_P (reg) && STRICT_ALIGNMENT
>            && MEM_ALIGN (reg) < GET_MODE_ALIGNMENT (omode)
>            && known_le (osize, isize))
>     return false;
> ```

Oh wait paradoxical is not included there anyways; so yes this is very much
related to PR120329.  And even if the known_le was removed then it still does
not taken into account Big-endian ...

So this is a big can of worms it seems.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.