Index: gcc/testsuite/gfortran.dg/lto/pr41576_0.f90
===================================================================
--- gcc/testsuite/gfortran.dg/lto/pr41576_0.f90	(revision 0)
+++ gcc/testsuite/gfortran.dg/lto/pr41576_0.f90	(revision 0)
@@ -0,0 +1,10 @@
+! { dg-lto-do run }
+! { dg-lto-options { { -O2 -flto -Werror } } }
+
+subroutine foo
+  common /bar/ a, b
+  integer(4) :: a ,b
+  a = 1
+  b = 2
+end
+
Index: gcc/testsuite/gfortran.dg/lto/pr41576_1.f90
===================================================================
--- gcc/testsuite/gfortran.dg/lto/pr41576_1.f90	(revision 0)
+++ gcc/testsuite/gfortran.dg/lto/pr41576_1.f90	(revision 0)
@@ -0,0 +1,7 @@
+program test
+  common /bar/ c, d
+  integer(4) :: c, d
+  call foo
+  if (c/=1 .or. d/=2) call abort
+end program test
+
