LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 21500 - Incorrect assembly in .macro
Summary: Incorrect assembly in .macro
Status: RESOLVED FIXED
Alias: None
Product: new-bugs
Classification: Unclassified
Component: new bugs (show other bugs)
Version: 3.4
Hardware: PC FreeBSD
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-06 07:13 PST by Richard Henderson
Modified: 2014-11-07 19:43 PST (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Henderson 2014-11-06 07:13:01 PST
$ cat z.S
#define FOO	15
.macro	bar
	andl	$FOO, %eax
.endm
	bar
$ cc -c z.S
$ objdump -d z.o

z.o:     file format elf64-x86-64-freebsd


Disassembly of section .text:

0000000000000000 <.text>:
   0:	23 04 25 05 00 00 00 	and    0x5,%eax


Note "0x5" not the expected "0xf".

$ cc -v
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd10.1
Thread model: posix
Selected GCC installation:
Comment 1 Dimitry Andric 2014-11-07 19:43:38 PST
This is fixed in trunk r201784, which is not in clang 3.4.1.  Since the fix is fairly simple, I will import this revision into FreeBSD.