diff options
author | Zack Weinberg <zack@wolery.cumb.org> | 2000-09-07 22:24:34 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2000-09-07 22:24:34 +0000 |
commit | 8b97c5f8ef218afce7499abe8cd3e6eb1f729306 (patch) | |
tree | a9b9cd034b9b3c1cc173cb5e609c95a9d4411d72 /gcc/config/i960/i960.c | |
parent | 1898584f04c8d512f9ed50de977cc266fc2a3b15 (diff) | |
download | gcc-8b97c5f8ef218afce7499abe8cd3e6eb1f729306.zip gcc-8b97c5f8ef218afce7499abe8cd3e6eb1f729306.tar.gz gcc-8b97c5f8ef218afce7499abe8cd3e6eb1f729306.tar.bz2 |
c-pragma.h: Define HANDLE_GENERIC_PRAGMAS if REGISTER_TARGET_PRAGMAS is defined.
* c-pragma.h: Define HANDLE_GENERIC_PRAGMAS if
REGISTER_TARGET_PRAGMAS is defined. Duplicate some
definitions from cpplib.h.
* cpplib.h: Don't typedef struct cpp_reader if c-pragma.h has
already done it.
* tm.texi: Document HANDLE_PRAGMA as no longer supported. Add
documentation for REGISTER_TARGET_PRAGMAS.
* c-lex.c: Include cpplib.h before c-pragma.h. Define a
default-pragma callback to implement -Wunknown-pragmas if
USE_CPPLIB.
* c-parse.in: Move all includes to top of file.
* c-pragma.c: Include cpplib.h before c-pragma.h. Include
tm_p.h.
(dispatch_pragma): Put the namespace in the -Wunknown-pragmas
warning.
(init_pragma): If REGISTER_TARGET_PRAGMAS is defined, call it.
* arm.h, arm-protos.h, arm.c,
c4x.h, c4x-protos.h, c4x.c,
h8300.h, h8300-protos.h, h8300.c,
i370.h, i370-protos.h, i370.c,
i960.h, i960-protos.h, i960.c,
sh.h, sh-protos.h, sh.c,
v850.h, v850-protos.h, v850.c: Convert HANDLE_PRAGMA-based
pragmata scheme to use REGISTER_TARGET_PRAGMAS instead.
* d30v.h: Don't mention HANDLE_PRAGMA in comment. Add
multiple include guard.
* i370.md (untyped_call): Use GEN_CALL.
(umodsi3): Remove unused variable.
* sh/elf.h: Don't undef HANDLE_SYSV_PRAGMA.
* v850.c (output_move_single, output_move_double): Constify
return value.
(print_operand): Constify a char *.
* v850.h (struct small_memory_info): Constify name member.
From-SVN: r36249
Diffstat (limited to 'gcc/config/i960/i960.c')
-rw-r--r-- | gcc/config/i960/i960.c | 118 |
1 files changed, 83 insertions, 35 deletions
diff --git a/gcc/config/i960/i960.c b/gcc/config/i960/i960.c index e8e046d..21753a2 100644 --- a/gcc/config/i960/i960.c +++ b/gcc/config/i960/i960.c @@ -42,6 +42,9 @@ Boston, MA 02111-1307, USA. */ #include "function.h" #include "recog.h" #include "toplev.h" +#include "cpplib.h" +#include "c-pragma.h" +#include "c-lex.h" #include "tm_p.h" /* Save the operands last given to a compare for use when we @@ -88,8 +91,86 @@ static int ret_label = 0; /* Handle pragmas for compatibility with Intel's compilers. */ -/* ??? This is incomplete, since it does not handle all pragmas that the - intel compilers understand. */ +/* NOTE: ic960 R3.0 pragma align definition: + + #pragma align [(size)] | (identifier=size[,...]) + #pragma noalign [(identifier)[,...]] + + (all parens are optional) + + - size is [1,2,4,8,16] + - noalign means size==1 + - applies only to component elements of a struct (and union?) + - identifier applies to structure tag (only) + - missing identifier means next struct + + - alignment rules for bitfields need more investigation. + + This implementation only handles the case of no identifiers. */ + +void +i960_pr_align (pfile) + cpp_reader *pfile ATTRIBUTE_UNUSED; +{ + tree number; + enum cpp_ttype type; + int align; + + type = c_lex (&number); + if (type == CPP_OPEN_PAREN) + type = c_lex (&number); + if (type == CPP_NAME) + { + warning ("sorry, not implemented: #pragma align NAME=SIZE"); + return; + } + if (type != CPP_NUMBER) + { + warning ("malformed #pragma align - ignored"); + return; + } + + align = TREE_INT_CST_LOW (number); + switch (align) + { + case 0: + /* Return to last alignment. */ + align = i960_last_maxbitalignment / 8; + /* Fall through. */ + case 16: + case 8: + case 4: + case 2: + case 1: + i960_last_maxbitalignment = i960_maxbitalignment; + i960_maxbitalignment = align * 8; + break; + + default: + /* Silently ignore bad values. */ + break; + } +} + +void +i960_pr_noalign (pfile) + cpp_reader *pfile ATTRIBUTE_UNUSED; +{ + enum cpp_ttype type; + tree number; + + type = c_lex (&number); + if (type == CPP_OPEN_PAREN) + type = c_lex (&number); + if (type == CPP_NAME) + { + warning ("sorry, not implemented: #pragma noalign NAME"); + return; + } + + i960_last_maxbitalignment = i960_maxbitalignment; + i960_maxbitalignment = 8; +} int process_pragma (p_getc, p_ungetc, pname) @@ -132,40 +213,7 @@ process_pragma (p_getc, p_ungetc, pname) align = atoi (buf); - switch (align) - { - case 0: - /* Return to last alignment. */ - align = i960_last_maxbitalignment / 8; - /* Fall through. */ - case 16: - case 8: - case 4: - case 2: - case 1: - i960_last_maxbitalignment = i960_maxbitalignment; - i960_maxbitalignment = align * 8; - break; - - default: - /* Silently ignore bad values. */ - break; - } - /* NOTE: ic960 R3.0 pragma align definition: - - #pragma align [(size)] | (identifier=size[,...]) - #pragma noalign [(identifier)[,...]] - - (all parens are optional) - - - size is [1,2,4,8,16] - - noalign means size==1 - - applies only to component elements of a struct (and union?) - - identifier applies to structure tag (only) - - missing identifier means next struct - - - alignment rules for bitfields need more investigation */ return 1; } |