* final.c (HAVE_READONLY_DATA_SECTION): New.
[official-gcc.git] / gcc / config / rs6000 / rs6000-c.c
blob33ce2a1420d47673e57339de9ac21609e5a065e2
1 /* Subroutines for the C front end on the POWER and PowerPC architectures.
2 Copyright (C) 2002
3 Free Software Foundation, Inc.
5 Contributed by Zack Weinberg <zack@codesourcery.com>
7 This file is part of GNU CC.
9 GNU CC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
14 GNU CC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with GNU CC; see the file COPYING. If not, write to
21 the Free Software Foundation, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
24 #include "config.h"
25 #include "system.h"
26 #include "cpplib.h"
27 #include "tree.h"
28 #include "c-lex.h"
29 #include "errors.h"
30 #include "tm_p.h"
32 /* Handle the machine specific pragma longcall. Its syntax is
34 # pragma longcall ( TOGGLE )
36 where TOGGLE is either 0 or 1.
38 rs6000_default_long_calls is set to the value of TOGGLE, changing
39 whether or not new function declarations receive a longcall
40 attribute by default. */
42 #define SYNTAX_ERROR(msgid) do { \
43 warning (msgid); \
44 warning ("ignoring malformed #pragma longcall"); \
45 return; \
46 } while (0)
48 void
49 rs6000_pragma_longcall (pfile)
50 cpp_reader *pfile ATTRIBUTE_UNUSED;
52 tree x, n;
54 /* If we get here, generic code has already scanned the directive
55 leader and the word "longcall". */
57 if (c_lex (&x) != CPP_OPEN_PAREN)
58 SYNTAX_ERROR ("missing open paren");
59 if (c_lex (&n) != CPP_NUMBER)
60 SYNTAX_ERROR ("missing number");
61 if (c_lex (&x) != CPP_CLOSE_PAREN)
62 SYNTAX_ERROR ("missing close paren");
64 if (n != integer_zero_node && n != integer_one_node)
65 SYNTAX_ERROR ("number must be 0 or 1");
67 if (c_lex (&x) != CPP_EOF)
68 warning ("junk at end of #pragma longcall");
70 rs6000_default_long_calls = (n == integer_one_node);