This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/65220] [4.8/4.9/5 Regression] integer division in stack alignment for VLA allocation
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 26 Feb 2015 14:18:32 +0000
- Subject: [Bug rtl-optimization/65220] [4.8/4.9/5 Regression] integer division in stack alignment for VLA allocation
- Auto-submitted: auto-generated
- References: <bug-65220-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65220
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
See r164593. expand_divmod works just fine, but here we aren't dividing by
CONST_INT, but virtual reg.
One way to improve this, if crtl->preferred_stack_boundary is always a power of
two, would be to add another virtual register,
virtual_preferred_stack_boundary_log_rtx, which would be substituted with
exact_log2 (crtl->preferred_stack_boundary / BITS_PER_UNIT).
Another possibility is to tweak i?86 udivmod* patterns, so that they would
accept non-immediates and power of two CONST_INTs, but because that patterns
computes both division and modulus, we'd need to split that into LSHIFTRT and
AND. As i?86 is the only target with SUPPORTS_STACK_ALIGNMENT support, perhaps
this change would be more kind to all other targets.