Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
566cdc73
Commit
566cdc73
authored
30 years ago
by
Michael Meissner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add -fpack-struct.
From-SVN: r9275
parent
7b09543e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
3 deletions
+18
-3
gcc/Makefile.in
+1
-1
gcc/flags.h
+4
-1
gcc/stor-layout.c
+9
-1
gcc/toplev.c
+4
-0
No files found.
gcc/Makefile.in
View file @
566cdc73
...
...
@@ -1083,7 +1083,7 @@ convert.o: convert.c $(CONFIG_H) $(TREE_H) flags.h convert.h
tree.o
:
tree.c $(CONFIG_H) $(TREE_H) flags.h function.h
print-tree.o
:
print-tree.c $(CONFIG_H) $(TREE_H)
stor-layout.o
:
stor-layout.c $(CONFIG_H) $(TREE_H) function.h
stor-layout.o
:
stor-layout.c $(CONFIG_H) $(TREE_H) f
lags.h f
unction.h
fold-const.o
:
fold-const.c $(CONFIG_H) $(TREE_H) flags.h
toplev.o
:
toplev.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h input.h
\
insn-attr.h xcoffout.h defaults.h output.h
...
...
This diff is collapsed.
Click to expand it.
gcc/flags.h
View file @
566cdc73
/* Compilation switch flag definitions for GNU CC.
Copyright (C) 1987, 1988, 1994 Free Software Foundation, Inc.
Copyright (C) 1987, 1988, 1994
, 1995
Free Software Foundation, Inc.
This file is part of GNU CC.
...
...
@@ -334,6 +334,9 @@ extern int flag_verbose_asm;
/* -fgnu-linker specifies use of the GNU linker for initializations.
-fno-gnu-linker says that collect will be used. */
extern
int
flag_gnu_linker
;
/* Tag all structures with __attribute__(packed) */
extern
int
flag_pack_struct
;
/* Other basic status info about current function. */
...
...
This diff is collapsed.
Click to expand it.
gcc/stor-layout.c
View file @
566cdc73
/* C-compiler utilities for types and variables storage layout
Copyright (C) 1987, 1988, 1992, 1993, 1994 Free Software Foundation, Inc.
Copyright (C) 1987, 1988, 1992, 1993, 1994
, 1995
Free Software Foundation, Inc.
This file is part of GNU CC.
...
...
@@ -22,6 +22,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdio.h>
#include "tree.h"
#include "flags.h"
#include "function.h"
#define CEIL(x,y) (((x) + (y) - 1) / (y))
...
...
@@ -241,6 +242,8 @@ layout_decl (decl, known_align)
DECL_BIT_FIELD_TYPE
(
decl
)
=
DECL_BIT_FIELD
(
decl
)
?
type
:
0
;
if
(
maximum_field_alignment
!=
0
)
DECL_ALIGN
(
decl
)
=
MIN
(
DECL_ALIGN
(
decl
),
maximum_field_alignment
);
else
if
(
flag_pack_struct
)
DECL_ALIGN
(
decl
)
=
MIN
(
DECL_ALIGN
(
decl
),
BITS_PER_UNIT
);
}
if
(
DECL_BIT_FIELD
(
decl
)
...
...
@@ -364,6 +367,8 @@ layout_record (rec)
int
type_align
=
TYPE_ALIGN
(
TREE_TYPE
(
field
));
if
(
maximum_field_alignment
!=
0
)
type_align
=
MIN
(
type_align
,
maximum_field_alignment
);
else
if
(
flag_pack_struct
)
type_align
=
MIN
(
type_align
,
BITS_PER_UNIT
);
record_align
=
MAX
(
record_align
,
type_align
);
}
...
...
@@ -406,6 +411,7 @@ layout_record (rec)
&&
!
DECL_PACKED
(
field
)
/* If #pragma pack is in effect, turn off this feature. */
&&
maximum_field_alignment
==
0
&&
!
flag_pack_struct
&&
!
integer_zerop
(
DECL_SIZE
(
field
)))
{
int
type_align
=
TYPE_ALIGN
(
TREE_TYPE
(
field
));
...
...
@@ -440,6 +446,8 @@ layout_record (rec)
if
(
maximum_field_alignment
!=
0
)
type_align
=
MIN
(
type_align
,
maximum_field_alignment
);
else
if
(
flag_pack_struct
)
type_align
=
MIN
(
type_align
,
BITS_PER_UNIT
);
/* A bit field may not span the unit of alignment of its type.
Advance to next boundary if necessary. */
...
...
This diff is collapsed.
Click to expand it.
gcc/toplev.c
View file @
566cdc73
...
...
@@ -513,6 +513,9 @@ int flag_gnu_linker = 0;
int
flag_gnu_linker
=
1
;
#endif
/* Tag all structures with __attribute__(packed) */
int
flag_pack_struct
=
0
;
/* Table of language-independent -f options.
STRING is the option name. VARIABLE is the address of the variable.
ON_VALUE is the value to store in VARIABLE
...
...
@@ -558,6 +561,7 @@ struct { char *string; int *variable; int on_value;} f_options[] =
{
"inhibit-size-directive"
,
&
flag_inhibit_size_directive
,
1
},
{
"verbose-asm"
,
&
flag_verbose_asm
,
1
},
{
"gnu-linker"
,
&
flag_gnu_linker
,
1
},
{
"pack-struct"
,
&
flag_pack_struct
,
1
},
{
"bytecode"
,
&
output_bytecode
,
1
}
};
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment