Bug 52692 - [avr]: Add support for avr-specific built-ins + LTO
Summary: [avr]: Add support for avr-specific built-ins + LTO
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.7.0
: P4 enhancement
Target Milestone: 4.7.1
Assignee: Georg-Johann Lay
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-23 20:34 UTC by Georg-Johann Lay
Modified: 2012-03-28 10:53 UTC (History)
2 users (show)

See Also:
Host:
Target: avr
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-03-23 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Georg-Johann Lay 2012-03-23 20:34:54 UTC
Implement TARGET_BUILTIN_DECL so that the following works:

int main (void) 
{ 
    __builtin_avr_delay_cycles (1000); 
    return 0; 
}

Currently, this prints

$ avr-gcc main.c -S -flto

main.c:7:1: sorry, unimplemented: tree bytecode streams do not support machine specific builtin functions on this target
Comment 1 Georg-Johann Lay 2012-03-28 09:13:47 UTC
Author: gjl
Date: Wed Mar 28 09:13:41 2012
New Revision: 185910

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185910
Log:
gcc/
	PR target/52692
	* config/avr/avr.c (TARGET_BUILTIN_DECL): New define.
	(avr_builtin_decl): New static function.
	(struct avr_builtin_description, avr_bdesc): Move up.
	Add GTY marker. Add field fndecl. Remove redundant field id.
	(avr_init_builtins): Initialize avr_bdesc[ID].fndecl.
	(avr_expand_builtin): Code cleanup because .id is removed.
	
testsuite/
	PR target/52692
	* gcc.target/avr/torture/builtins-2.c: New test.


Added:
    trunk/gcc/testsuite/gcc.target/avr/torture/builtins-2.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/avr/avr.c
    trunk/gcc/testsuite/ChangeLog
Comment 2 Georg-Johann Lay 2012-03-28 09:19:30 UTC
Author: gjl
Date: Wed Mar 28 09:19:10 2012
New Revision: 185911

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185911
Log:
gcc/
	Backport from 2012-03-28 mainline r185910.

	PR target/52692
	* config/avr/avr.c (TARGET_BUILTIN_DECL): New define.
	(avr_builtin_decl): New static function.
	(struct avr_builtin_description, avr_bdesc): Move up.
	Add GTY marker. Add field fndecl. Remove redundant field id.
	(avr_init_builtins): Initialize avr_bdesc[ID].fndecl.
	(avr_expand_builtin): Code cleanup because .id is removed.
	
testsuite/
	Backport from 2012-03-28 mainline r185910.

	PR target/52692
	* gcc.target/avr/torture/builtins-2.c: New test.


Added:
    branches/gcc-4_7-branch/gcc/testsuite/gcc.target/avr/torture/builtins-2.c
Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/config/avr/avr.c
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
Comment 3 Georg-Johann Lay 2012-03-28 10:53:19 UTC
Fixed in 4.7.1