This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Do not report non-executed blocks in Ada coverage


On 11/03/2017 12:51 PM, Eric Botcazou wrote:
Hi,

as explained in
   https://gcc.gnu.org/ml/gcc-patches/2017-11/msg00105.html
we don't (necessarily) want to report non-executed blocks in Ada.

The couple of attached patches prevent this from happening by detecting
whether we are dealing with an Ada file; the first variant is optimal, the
second variant is slightly more general in case other languages need it too.

Hello.

I would probably incline to emit some information to *.gcno file that will reflect
that we should not report unexecuted blocks.

However, as I've been reading dump file:

P.Add (const integer i1, const integer i2)
{
  complex int D.4219;
  integer iftmp.2;
  integer D.4217;
  integer _1;
  complex int _4;
  integer iftmp.2_5;
  integer _6;

  <bb 2> [0.00%]:
  _4 = ADD_OVERFLOW (i1_2(D), i2_3(D));
  _1 = IMAGPART_EXPR <_4>;
  if (_1 != 0)
    goto <bb 3>; [0.00%]
  else
    goto <bb 4>; [0.00%]

  <bb 3> [0.00%]:
  .gnat_rcheck_CE_Overflow_Check ("p.adb", 5);

  <bb 4> [0.00%]:
  iftmp.2_5 = REALPART_EXPR <_4>;
  _6 = iftmp.2_5;

<L3> [0.00%]:
  return _6;

}

Isn't the <bb 3> some kind of exceptional basic block? Can one find such blocks in middle-end?
In case of C++, exceptional blocks are not considered for the warning.

Thanks,
Martin


Tested on x86_64-suse-linux, OK for the mainline (and which one)?


2017-11-03  Eric Botcazou  <ebotcazou@adacore.com>

	* gcov.c (output_line_beginning): Document HAS_UNEXECUTED_BLOCK.
	(output_lines): Always pass false for HAS_UNEXECUTED_BLOCK to
	above function if this is for an Ada file.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]