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 17784 - Large constant materialized twice
Summary: Large constant materialized twice
Status: NEW
Alias: None
Product: libraries
Classification: Unclassified
Component: Common Code Generator Code (show other bugs)
Version: trunk
Hardware: PC All
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-02 13:18 PDT by Rafael Ávila de Espíndola
Modified: 2013-11-04 10:00 PST (History)
2 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 Rafael Ávila de Espíndola 2013-11-02 13:18:06 PDT
Given

#include <stdint.h>
uint64_t val, *p;
extern uint64_t xtr( uint64_t);

uint64_t caller() {
        uint64_t x;
        p = &val;
        x = 12345123400L;
        *p = x;
        return xtr(x);
}

clang produces

	movq	%rax, (%rcx)
	movabsq	$12345123400, %rcx      ## imm = 0x2DFD3A248
	movq	%rcx, (%rax)
	movabsq	$12345123400, %rdi      ## imm = 0x2DFD3A248


There was a thread about this bug in:

http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-August/064535.html