Add missing return in gori_compute::logical_combine

Message ID 1963524.usQuhbGJ8B@fomalhaut
State Accepted
Headers
Series Add missing return in gori_compute::logical_combine |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Eric Botcazou Sept. 25, 2023, 3:51 p.m. UTC
  Hi,

the varying case currently falls through to the 1/true case.

Tested on x86_64-suse-linux, OK for mainline, 13 and 12 branches?


2023-09-25  Eric Botcazou  <ebotcazou@adacore.com>

	* gimple-range-gori.cc (gori_compute::logical_combine): Add missing
	return statement in the varying case.


2023-09-25  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/opt102.adb:New test.
	* gnat.dg/opt102_pkg.adb, gnat.dg/opt102_pkg.ads: New helper.
  

Comments

Andrew MacLeod Sept. 25, 2023, 5:09 p.m. UTC | #1
OK for trunk at least.   Thanks.  I presume it'll be fine for the other 
releases.

Andrew

On 9/25/23 11:51, Eric Botcazou wrote:
> Hi,
>
> the varying case currently falls through to the 1/true case.
>
> Tested on x86_64-suse-linux, OK for mainline, 13 and 12 branches?
>
>
> 2023-09-25  Eric Botcazou  <ebotcazou@adacore.com>
>
> 	* gimple-range-gori.cc (gori_compute::logical_combine): Add missing
> 	return statement in the varying case.
>
>
> 2023-09-25  Eric Botcazou  <ebotcazou@adacore.com>
>
> 	* gnat.dg/opt102.adb:New test.
> 	* gnat.dg/opt102_pkg.adb, gnat.dg/opt102_pkg.ads: New helper.
>
  

Patch

diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc
index 51fb542a19c..2694e551d73 100644
--- a/gcc/gimple-range-gori.cc
+++ b/gcc/gimple-range-gori.cc
@@ -876,6 +876,7 @@  gori_compute::logical_combine (vrange &r, enum tree_code code,
 	  r.dump (dump_file);
 	  fputc ('\n', dump_file);
 	}
+      return res;
     }
 
   switch (code)