This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [buildrobot] sparc64-linux broken
- From: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Henderson <rth at redhat dot com>, Jan-Benedict Glaw <jbglaw at lug-owl dot de>, gcc at gcc dot gnu dot org, "David S. Miller" <davem at redhat dot com>, Eric Botcazou <ebotcazou at libertysurf dot fr>
- Date: Mon, 21 Apr 2014 17:51:04 -0400
- Subject: Re: [buildrobot] sparc64-linux broken
- Authentication-results: sourceware.org; auth=none
- References: <20140419195406 dot GX648 at lug-owl dot de> <20140421165334 dot GA20482 at lug-owl dot de> <53555227 dot 2080609 at redhat dot com> <20140421180239 dot GG1817 at tucnak dot redhat dot com>
On Mon, Apr 21, 2014 at 08:02:39PM +0200, Jakub Jelinek wrote:
> Sure, we could change this to use mode_size_inline ((enum machine_mode) (MODE))
> in the macro instead, but I'd say for GCC codebase it is better if we fix
> the few users of these macros that pass an int rather than enum machine_mode
> to these macros.
I fixed the powerpc (PR 60876), and while it would have been nice to have
tested this against more backends, it was fairly simple to go through the
GET_MODE_SIZE's and make them type correct. For the PowerPC, it tended to be
in code of the form:
for (m = 0; m < NUM_MACHINE_MODES; ++m)
{
// ...
if (GET_MODE_SIZE (m)) ...
}
and the fix was to do something like:
for (m = 0; m < NUM_MACHINE_MODES; ++m)
{
enum machine_mode m2 = (enum machine_mode)m;
// ...
if (GET_MODE_SIZE (m2)) ...
}
It reminds me when I was in the original ANSI C committee that made the 1989
ANSI and 1990 ISO C standards, we debated making enum's more first class
citizens, so you could do ++/-- on them, but the committee tended to be divided
into 3 camps, one that wanted to delete enums altogether, one that wanted them
as int constants, and one that wanted more type checking.
--
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meissner@linux.vnet.ibm.com, phone: +1 (978) 899-4797