Skip to content

Store <64 x i1> generates incorrect code #29963

@aqjune

Description

@aqjune
Bugzilla Link 30615
Version trunk
OS Linux
Blocks #30613
Attachments Three files (two .c files and one .ll file) that show buggy behavior.
CC @hfinkel,@aqjune,@nunoplopes,@sanjoy

Extended Description

store <64 x i1> %1, <64 x i1>* ptr generates incorrect code.

I attach the source code. I compiled these files with

clang -O2 -c -o main.o main.c
clang -O2 -c -o visitelem.o visitelem.c

llc -filetype=obj -o loadval.o loadval.ll
gcc loadval.o main.o visitelem.o -o main

./main

Without store <64 x i1> %1, <64 x i1>* @&#8203;globalvar, align 8, in loadval.ll, it prints

visitelem : 1111
visitelem : 1111
visitelem : 0
visitelem : 0

However with the store it prints

visitelem : 0
visitelem : 0
visitelem : 0
visitelem : 0

even if %ptr and @globalvar points to distinct address.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions