This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Bug in highest_pow2_factor
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: mark at codesourcery dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 2 May 02 16:03:45 EDT
- Subject: Re: Bug in highest_pow2_factor
Well, so far, we don't even have a regression, so I'm not sure we have
to do anything for 3.1. I'm trying to understand this better.
Well, we have *potential* regressions in that things that were done
in a different way are now done using that function, so it if doesn't
work properly those things that used to work won't.
So, check for overflow later. Or, define the function to never return
a value bigger than BIGGEST_ALIGNMENT, and then do that in the case
you have by masking out bits if c0 that are bigger than that.
I thought of limiting it to BIGGEST_ALIGNMENT (or actually
HIGH_OFILE_ALIGNMENT, or whatever it's called), but I'm not sure
there's a point in that.
Is the "highest power of two" ever negative?
No. And my patch contains comments to make that clear.