Bug 24857 - ada/s-auxdec.ads alignment issue for arm-rtems
Summary: ada/s-auxdec.ads alignment issue for arm-rtems
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 4.1.0
: P3 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: build, patch
Depends on:
Blocks:
 
Reported: 2005-11-14 19:47 UTC by Laurent GUERBY
Modified: 2005-11-19 00:33 UTC (History)
3 users (show)

See Also:
Host:
Target: arm-rtems
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-11-14 20:37:55


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent GUERBY 2005-11-14 19:47:50 UTC
From Joel Sherrill:

Gcc on the head  fails to compile arm-rtems4.7 at the following point
when Ada is enabled.

../../xgcc -B../../  -c -g -O2      -W -Wall -gnatpg  s-auxdec.adb -o 
s-auxdec.o
s-auxdec.ads:286:13: alignment for "Aligned_Word" must be at least 4

The code is:

   type Aligned_Word is record
      Value : Short_Integer;
   end record;

   for Aligned_Word'Alignment use
      Integer'Min (2, Standard'Maximum_Alignment);

I (Laurent) think Standard'Maximum_Alignment comes from ada/targtyps.c
 
get_target_maximum_alignment (void)
{
  return BIGGEST_ALIGNMENT / BITS_PER_UNIT;
}
 
Joel confirmed that changing "Min (2" to "Min (4" enable this file to be compiled, however my reading of the source would imply that BIGGEST_ALIGNMENT is at least 32 on arm, so something else must be at play here, any idea?
Comment 1 Eric Botcazou 2005-11-14 20:37:43 UTC
> Joel confirmed that changing "Min (2" to "Min (4" enable this file to be
> compiled, however my reading of the source would imply that BIGGEST_ALIGNMENT
> is at least 32 on arm, so something else must be at play here, any idea?

Excerpt from config/arm/arm.h:

/* Setting STRUCTURE_SIZE_BOUNDARY to 32 produces more efficient code, but the
   value set in previous versions of this toolchain was 8, which produces more
   compact structures.  The command line option -mstructure_size_boundary=<n>
   can be used to change this value.  For compatibility with the ARM SDK
   however the value should be left at 32.  ARM SDT Reference Manual (ARM DUI
   0020D) page 2-20 says "Structures are aligned on word boundaries".
   The AAPCS specifies a value of 8.  */
#define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary
extern int arm_structure_size_boundary;

/* This is the value used to initialize arm_structure_size_boundary.  If a
   particular arm target wants to change the default value it should change
   the definition of this macro, not STRUCTURE_SIZE_BOUNDARY.  See netbsd.h
   for an example of this.  */
#ifndef DEFAULT_STRUCTURE_SIZE_BOUNDARY
#define DEFAULT_STRUCTURE_SIZE_BOUNDARY 32
#endif
Comment 2 Laurent Guerby 2005-11-17 11:13:26 UTC
Subject: Bug 24857

Author: guerby
Date: Thu Nov 17 11:13:18 2005
New Revision: 107116

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107116
Log:
2005-11-17  Laurent GUERBY  <laurent@guerby.net>

	PR ada/24857
	* s-auxdec-empty.ads, s-auxdec-empty.adb: New files.


Added:
    trunk/gcc/ada/s-auxdec-empty.adb
    trunk/gcc/ada/s-auxdec-empty.ads
Modified:
    trunk/gcc/ada/ChangeLog

Comment 3 Laurent Guerby 2005-11-18 11:44:25 UTC
Subject: Bug 24857

Author: guerby
Date: Fri Nov 18 11:44:20 2005
New Revision: 107175

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107175
Log:
2005-11-18  Laurent GUERBY  <laurent@guerby.net>

        PR ada/24857
        * Makefile.in: Use s-auxdec-empty for RTEMS.



Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/Makefile.in

Comment 4 Joel Sherrill 2005-11-18 21:16:54 UTC
arm-rtems4.7 now builds.  The empty version is used for all RTEMS target.

Thanks.