This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ICE for overlap of asm-register-declared variable and asm clobber list [H8/S target]


Following code gives ICE (Internal compilation Error). I am compiling it for H8/S target. 
void bug(char* dst) 
	register char* _dst __asm ("er6");
	__asm__ ("eepmov.b":"=g"(*_dst)::"r4","er5","er6");
command used is:
>h8300-elf-gcc.exe -S bug.c bug.c

What is expected from this code while compiling is "Simple error" saying "asm-specifier for variable 'dst' conflicts with asm clobber list". Instead, it is giving an "Internal Compiler Error". 

Please refer to earlier posting related to this at

As per this patch, this conflict is detected in function "expand_asm_operands()" (stmt.c) while doing "SANITY" check for overlap between clobbers and output operands. 
I have two queries regarding this;

1. As it is well know conflict and error, does it really necessary to give an "Internal Compiler Error"? Or simple conflict error will do? I understand that, the compiler is expected to catch this conflict much earlier and output the error.

2. Where the compiler should catch this error prior to above mention "SANITY" check? I guess it should be able to this in "decl_conflicts_with_clobbers_p()" function. I would like to fix the above problem i.e. Compiler should detect above as clobber conflict and display the error "asm-specifier for variable 'dst' conflicts with asm clobber list" and NOT the ICE.

Any help on this would be highly appreciated.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]