This is an archive of the discontinued LLVM Phabricator instance.

[clang] Do not attempt to zero-extend _BitInt(1) when not required
ClosedPublic

Authored by Fznamznon on Apr 28 2023, 4:09 AM.

Details

Summary

ConvertTypeForMem doesn't return wider type for _BitInt unless it is
used in a bitfield, so no need to extend when trying to initialize a
global variable.

Fixes https://github.com/llvm/llvm-project/issues/62207

Diff Detail

Event Timeline

Fznamznon created this revision.Apr 28 2023, 4:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 28 2023, 4:09 AM
Fznamznon requested review of this revision.Apr 28 2023, 4:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 28 2023, 4:09 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
erichkeane accepted this revision.Apr 28 2023, 7:09 AM

This looks right to me, thanks!

This revision is now accepted and ready to land.Apr 28 2023, 7:09 AM
shafik accepted this revision.Apr 28 2023, 1:17 PM
shafik added a subscriber: shafik.

LGTM

clang/test/CodeGen/ext-int.c
8

Interesting, it looks like true and false are valid for i1 all the time.