public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Gcc plugin: error: ‘LAST_AND_UNUSED_RTX_CODE’ undeclared
@ 2010-02-26 17:52 ashish jain
  2010-02-26 18:05 ` Andrew Pinski
  0 siblings, 1 reply; 4+ messages in thread
From: ashish jain @ 2010-02-26 17:52 UTC (permalink / raw)
  To: gcc

Hi,

I am trying to write a simple gcc plugin and am getting the following errors.

In file included from /home/aj/gcc/trunk/gcc/rtl.h:49,                                                               
                 from /home/aj/gcc/testcode/plugin/ctla_gcc_plugin.c:22:                                             
/home/aj/gcc/trunk/gcc/rtl.def:336: error: expected identifier before ‘const’                                        
In file included from /home/aj/gcc/testcode/plugin/ctla_gcc_plugin.c:22:                                             
/home/aj/gcc/trunk/gcc/rtl.h:99: error: ‘LAST_AND_UNUSED_RTX_CODE’ undeclared here (not in a function)               
In file included from /home/aj/gcc/trunk/gcc/basic-block.h:28,                                                       
                 from /home/aj/gcc/testcode/plugin/ctla_gcc_plugin.c:23:                                             
/home/aj/gcc/trunk/gcc/hard-reg-set.h: In function ‘hard_reg_set_iter_set’:                                          
/home/aj/gcc/trunk/gcc/hard-reg-set.h:545: error: ‘FIRST_PSEUDO_REGISTER’ undeclared (first use in this function)    
/home/aj/gcc/trunk/gcc/hard-reg-set.h:545: error: (Each undeclared identifier is reported only once                  
/home/aj/gcc/trunk/gcc/hard-reg-set.h:545: error: for each function it appears in.)                                  
/home/aj/gcc/trunk/gcc/hard-reg-set.h: At top level:                                                                 
/home/aj/gcc/trunk/gcc/hard-reg-set.h:583: error: ‘FIRST_PSEUDO_REGISTER’ undeclared here (not in a function)        
/home/aj/gcc/trunk/gcc/hard-reg-set.h:644: error: ‘N_REG_CLASSES’ undeclared here (not in a function)                
In file included from /home/aj/gcc/trunk/gcc/basic-block.h:31,                                                       
                 from /home/aj/gcc/testcode/plugin/ctla_gcc_plugin.c:23:
/home/aj/gcc/trunk/gcc/function.h:222: error: expected specifier-qualifier-list before ‘CUMULATIVE_ARGS’
/home/aj/gcc/trunk/gcc/function.h:698: error: expected ‘)’ before ‘*’ token
/home/aj/gcc/trunk/gcc/function.h:700: error: expected ‘)’ before ‘*’ token
In file included from /home/aj/gcc/testcode/plugin/ctla_gcc_plugin.c:32:
/home/aj/gcc/trunk/gcc/target.h:910: error: expected ‘)’ before ‘*’ token
/home/aj/gcc/trunk/gcc/target.h:913: error: expected ‘;’ before ‘rtx’

I googled for a solution and found a similar message in which it was suggested to include "tm.h". I verified my code, and I am getting the same error even after including the file.

My CMake file is as follows:

set( GCC_SRC_DIR "/home/aj/gcc/trunk")
set( GCC_BUILD_DIR "/home/aj/gcc/trunk-obj" )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR} )
include_directories( ${GCC_BUILD_DIR}/gcc )
include_directories( ${GCC_SRC_DIR}/gcc )
include_directories( ${GCC_SRC_DIR}/libcpp/include )
include_directories( ${GCC_SRC_DIR}/include )
include_directories( ${GCC_SRC_DIR}/host-i686-pc-linux-gnu/gcc )

I am not able to figure out what is going wrong, can you please guide me on where am I making a mistake?

Thanks,
Ashish


      Your Mail works best with the New Yahoo Optimized IE8. Get it NOW! http://downloads.yahoo.com/in/internetexplorer/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Gcc plugin: error: ‘LAST_AND_UNUSED_RTX_CODE’ undeclared
  2010-02-26 17:52 Gcc plugin: error: ‘LAST_AND_UNUSED_RTX_CODE’ undeclared ashish jain
@ 2010-02-26 18:05 ` Andrew Pinski
  2010-02-27 13:16   ` ashish jain
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Pinski @ 2010-02-26 18:05 UTC (permalink / raw)
  To: ashish jain; +Cc: gcc

On Fri, Feb 26, 2010 at 9:26 AM, ashish jain <ashish_ddr2@yahoo.co.in> wrote:
> Hi,
>
> I am trying to write a simple gcc plugin and am getting the following errors.
>
> In file included from /home/aj/gcc/trunk/gcc/rtl.h:49,
>                 from /home/aj/gcc/testcode/plugin/ctla_gcc_plugin.c:22:
> /home/aj/gcc/trunk/gcc/rtl.def:336: error: expected identifier before ‘const’

From the looks of it, you have a define for CONST as const.  This
first error is the reason for the rest of the errors.

Thanks,
Andrew Pinski

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Gcc plugin: error: ‘LAST_AND_UNUSED_RTX_CODE’ undeclared
  2010-02-26 18:05 ` Andrew Pinski
@ 2010-02-27 13:16   ` ashish jain
  2010-02-27 19:26     ` Andrew Pinski
  0 siblings, 1 reply; 4+ messages in thread
From: ashish jain @ 2010-02-27 13:16 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: gcc

Hi,

--- On Fri, 26/2/10, Andrew Pinski <pinskia@gmail.com> wrote:

> From the looks of it, you have a define for CONST as
> const.  This
> first error is the reason for the rest of the errors.
> 
> Thanks,
> Andrew Pinski

I havent modified anything in that part of the code. Reordering the header files somehow made all the errors disappear.

Thanks,
Ashish Jain


      The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Gcc plugin: error: ‘LAST_AND_UNUSED_RTX_CODE’ undeclared
  2010-02-27 13:16   ` ashish jain
@ 2010-02-27 19:26     ` Andrew Pinski
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Pinski @ 2010-02-27 19:26 UTC (permalink / raw)
  To: ashish jain; +Cc: gcc

On Sat, Feb 27, 2010 at 12:55 AM, ashish jain <ashish_ddr2@yahoo.co.in> wrote:
> I havent modified anything in that part of the code. Reordering the header files somehow made all the errors disappear.

You should figure out what is doing the define of CONST then.  Because
from the sound of it, you are going to have problems if you try to use
the CONST rtx code.

Thanks,
Andrew Pinski

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-02-27 17:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-26 17:52 Gcc plugin: error: ‘LAST_AND_UNUSED_RTX_CODE’ undeclared ashish jain
2010-02-26 18:05 ` Andrew Pinski
2010-02-27 13:16   ` ashish jain
2010-02-27 19:26     ` Andrew Pinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).