New issue
Advanced search Search tips

Issue 703857 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocking:
issue 690756



Sign in to add a comment

llvm does not analyze cfg and produces incorrect warnings

Project Member Reported by manojgupta@chromium.org, Mar 21 2017

Issue description

This is the upstream bug https://bugs.llvm.org//show_bug.cgi?id=10030

Kernel folks who are trying to move to clang are hitting it: https://lkml.org/lkml/2017/3/11/61

From the upstream bug:
"Consider the following input:

int foo = 1 > 2 ? 1 << -1 : 0;

This results in a warning about the negative shift, even if that branch of the ternary operator is known to be unused. This does work inside a function e.g. as statement."
 
Cc: g...@chromium.org
gbiv@ Do you know who is right person to fix this? 
Simple repro case:

(cr) (master) manojgupta@manojgupta ~/trunk/src/scripts $ cat a.c
int foo = 1 > 2 ? 1 << -1 : 0;

int main()
{
	return foo;
}

(cr) (master) manojgupta@manojgupta ~/trunk/src/scripts $ clang a.c
a.c:1:21: warning: shift count is negative [-Wshift-count-negative]
int foo = 1 > 2 ? 1 << -1 : 0;
                    ^  ~~
1 warning generated.

Labels: OS-Chrome
mka@ Do you still need this one?
Components: Infra

Comment 6 by mmoss@chromium.org, Jan 2 2018

Components: -Infra Infra>Client>ChromeOS
[It appears that a bunch of old cros issues bulk-added the "Infra" component recently, but they should probably be "Infra>Client>ChromeOS".]
Status: Archived (was: Untriaged)
Components: -Infra>Client>ChromeOS
Status: Available (was: Archived)
Components: Tools>ChromeOS-Toolchain

Sign in to add a comment